Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create a split with already existing windows? #26

Open
sim590 opened this issue Jul 28, 2021 · 7 comments
Open

How to create a split with already existing windows? #26

sim590 opened this issue Jul 28, 2021 · 7 comments

Comments

@sim590
Copy link

sim590 commented Jul 28, 2021

I see that I can use win+v to create a vertical split with win+enter, but what about creating (changing) the split orientation with already existing windows?

@McYoloSwagHam
Copy link
Owner

I'm not sure I understand could you clarify?

@sim590
Copy link
Author

sim590 commented Jul 28, 2021

We can do the following (first method):

  1. Spawn a window using create_tile (mod+Enter).
  2. Configure next split in vertical mode with set_layout_vertical (mod+v)
  3. Spawn a window using create_tile (mod+Enter)

Then the split between the first window and the second is vertical.

But we can't do:

  1. Spawn a window using create_tile (mod+Enter).
  2. Spawn a window using create_tile (mod+Enter)
  3. Make the last split vertical

In this situation, from state of (3), if one wanted the split vertical between the last two windows, the only choice would be to close the second window and start from (2) from the first method and fix the layout. But the state of the second window was lost because we had to close it.

The thing is you may have a bunch of windows opened in some layout, but you might want to change the layout at some point. For now, the only way to change the layout is to close all windows (so lose the state for every windows already opened) and restart from the begining using the first method and not make any mistake in spawning the right windows in the right order because you can't change the layout afterwards.

Or else, I don't understand how it's done by reading the doc:

https://mcyoloswagham.github.io/win3wm/hotkeys.html

@McYoloSwagHam
Copy link
Owner

You can use mod+shift+d or flip_workspace to flip the workspace, though this applies it to the whole workspace
https://mcyoloswagham.github.io/win3wm/hotkeys.html#flip_workspace

@sim590
Copy link
Author

sim590 commented Aug 28, 2021

Yes. That is unfortunate. It would be interesting (as I think it is possible in i3) to change the orientation of the next split but not flip the whole layout.

@McYoloSwagHam
Copy link
Owner

McYoloSwagHam commented Aug 28, 2021

https://mcyoloswagham.github.io/win3wm/hotkeys.html#bsplit
That's already an option, it's called Binary Split (I took this name from yabai)

@sim590
Copy link
Author

sim590 commented Sep 13, 2021

In my last message, I meant last and not next in:

change the orientation of the next split but not flip the whole layout.

@sim590
Copy link
Author

sim590 commented May 26, 2022

@McYoloSwagHam: I would very much like to use this window manager since it seems to play better with windows than Workspacer. But this feature I'm talking about is missing.

In your last message, you replied with bsplit, but this opens a new window in vertical split. What I'm looking for is from a setting where you have already two windows opened (among more windows) and to put the second window under the first window. For example, in Sway (a window manager honoring i3 conventions in Wayland), we could have this:

image

where you can see respectively VIM, Qutebrowser and two other terminals opened. From there, everything is in the same container split horizontally. I don't want to change the orientation of that container. I want to go from there to:

image

Where the first window and the second window are now in a new container that is vertically split. That same container is itself with the other two terminals still in the same horizontally split container. So you have this hiarchy:


        [H]
        /\ -\
       /  \  ----\
      |    |      \
     [V]   |       \
     /\    urxvt  urxvt
    /  \
   /    \
  /      \
Vim      Qutebrowser

In short, when my winwm cursor is on the first window on the left and that I do the following from the first setting:

  1. mod+v (split vertically, so create a new container containing the selected window alone)
  2. mod+l (move the cursor to the second window on the right)
  3. mod+shift+h (move the window to the left, so under the new vertically split container)

Then I should obtain the second setting. Therefore, what I mean is that mod+v should not create a vertically split container only if a new window is spawn right after. But the container should simply be created. Then, I should be able to drag a window from wherever in my workspace and put it in the vertically split container so that the windows become vertically split. In other words, splitting vertically shouldn't be restricted or tied to the action of spawning a window. Therefore, mod+v should just create a vertically split container.

This is a huge gap that is present in winwm since you just can't change the orientation of split of some windows, but only all windows at a time or only newly create windows. I can't just know in advance which orientation I need for my windows before spawning them. First, I spawn them, then I change the orientation on the go, so I really need that feature. I think that it is quite a fundamental idea of i3 which is missing in your implementation.

N.B: there are edge cases to take into account. For example, if you press mod+v twice or more, then only one container should be created. We don't need to stack containers arbitrarly many times without first putting some other windows in the container. But that's an implementation detail.

Do you understand better what I mean now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants