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

h-spit and v-split as container layout #464

Closed
i3bot opened this issue Aug 6, 2011 · 8 comments
Closed

h-spit and v-split as container layout #464

i3bot opened this issue Aug 6, 2011 · 8 comments
Assignees
Labels

Comments

@i3bot
Copy link

i3bot commented Aug 6, 2011

[Originally reported by gravemind2a@…]
( I found, since v4, it's much more difficult to switch windows between Horizontally split and Vertically split.

I'm thinking about organisation of containers, and the solution that seems to me Perfect, is to have only 1 type of container and the split orientation is just a layout mode of containers.

So we will have something like that:

      workspace 1
          |
          |
      container 1
       layout=H
       /     \
      /       \

container 2 terminal C
layout=H
/
terminal A terminal B


| | | |
| A | B | C |

| | | |

Then, we can change the layout of container 1 to vericaly, and thats all.


| A | |
|-------| C |

| B | |

Please, think about it.

@i3bot
Copy link
Author

i3bot commented Aug 6, 2011

[Original comment by gravemind2a@…]

(Sorry for the syntax)


  So we will have something like that:

          workspace 1
              |
              |
          container 1
           layout=H
           /     \
          /       \
   container 2   terminal C
    layout=H
     /      \
terminal A  terminal B

----------------
|   |   |      |
| A | B |   C  |
|   |   |      |
----------------

Then, we can change the layout of container 1 to vericaly, and thats all.

----------------
|   A   |      |
|-------|   C  |
|   B   |      |
----------------

@stapelberg
Copy link
Member

Yeah, I also noticed that changing the orientation of an existing split container does not work as expected anymore. Will investigate.

The way how this should work is using focus parent, then split vertical to reach the second layout when being in the first one.

@i3bot
Copy link
Author

i3bot commented Aug 6, 2011

[Original comment by gravemind2a@…]

michael, yes, I know this way, but its heavy, and that's why a create this ticket.

I forgot to precise that h-split and v-split should be process like stacked and tabbed layout mode. So we should have 4 layout mode: stacked, tabbed, h-split and v-split.

@stapelberg
Copy link
Member

So I looked into this now. What I did is:

  1. Window A is focused
  2. Use focus parent, now the container containing A and B is focused
  3. Use alt+h to split h. Visibly, nothing happens. However, the container has now been split and opening a new window will make it use 25% of the screen (with the A-B-container taking 25% and C taking 50%).

So, this is working as intended. Changing a container’s orientation would make this feature impossible. Therefore, we need to introduce some other way to change an existing container’s orientation.

I agree that considering h-split/v-split containers just another layout would make sense for the user. I will think about it a little more (need to make sure this does not introduce any problems).

@i3bot
Copy link
Author

i3bot commented Nov 29, 2011

[Original comment by old4@…]

focus A and then split_v; focus right; move left does the job, but I agree that introducing a way to change existing container's orientation (maybe a new rotate command?) is desired.

I also find 4-layout design attractive, but I'd change stacked|tabbed|default to overlay|tiled. tiled would be just like default is now, and overlay would be like stacked or tabbed depending on container's orientation:
default → tiled
stacked → split_v/overlay
tabbed → split_h/overlay

What do you think?

There could be some more orientations like split_opposite that would have orientation opposite to parent container's orientation, but that's probably a matter for another feature request…

@i3bot
Copy link
Author

i3bot commented Nov 29, 2011

[Original comment by gravemind2a@…]

Right, I use it this way every day, even just A:split_v, new window.
But it feel uncomfortable to manipulate invisible things like move parent or invisible container.

My first raw idea is bugee, I still find it sexy, but there is a lot of work to do around it.
But my point was to find a way to use container orientations as easy as with the old i3.

So, I finally thing that change the orientation of a container will be enough for now.

End of the ticket (and michael, sorry to waste your time, you are doing a great job).

((( If I can just put down my ideas:

  • add a function split_auto that choose between split_h or split_v in function of the height/width ratio of the new container (h/w >= 1.0 ? split_v : split_h).
  • define a limit of the number of windows: max_split_windows 2. Then, when a new window is created, if we are in default_layout, and if max_split_windows is reached in the current container, split_auto the current window and push the new window in the new splited container.
    The goal still is to simplify (do it more natural) container manipulation.
    )))

@i3bot
Copy link
Author

i3bot commented Feb 28, 2012

[Original comment by lou]

Hi,

I just wanted to tell, that I tried out i3 for a day and I like it a lot because of the clean design, the sane default config, the handling of containers etc.
But lack of this feature keeps me from using it, but I will keep an eye on i3.

Best regards, lou

(In my use szenario I was looking for a way to toggle between

----------------
|   A   |      |
|-------|   C  |
|   B   |      |
----------------
and
----------------
|       C      |
|--------------|
|   A   |  B   |
----------------

because of my small screen estate of 1280x800 more then one vertical split makes the windows unusuable. I can imagine I am not the only one with this problem.)

@stapelberg
Copy link
Member

This ticket was fixed in commit http://c.i3wm.org/de94f6da:
Introduce splith/splitv layouts, remove orientation

With this commit, the "default" layout is replaced by the splith and
splitv layouts. splith is equivalent to default with orientation
horizontal and splitv is equivalent to default with orientation
vertical.

The "split h" and "split v" commands continue to work as before, they
split the current container and you will end up in a split container
with layout splith (after "split h") or splitv (after "split v").

To change a splith container into a splitv container, use either "layout
splitv" or "layout toggle split". The latter command is used in the
default config as mod+l (previously "layout default"). In case you have
"layout default" in your config file, it is recommended to just replace
it by "layout toggle split", which will work as "layout default" did
before when pressing it once, but toggle between horizontal/vertical
when pressing it repeatedly.

The rationale behind this commit is that it’s cleaner to have all
parameters that influence how windows are rendered in the layout itself
rather than having a special parameter in combination with only one
layout. This enables us to change existing split containers in all cases
without breaking existing features (see ticket #464). Also, users should
feel more confident about whether they are actually splitting or just
changing an existing split container now.

As a nice side-effect, this commit brings back the "layout toggle"
feature we once had in i3 version 3 (see the userguide).

AFAIK, it is safe to use in-place restart to upgrade into versions
after this commit (switching to an older version will break your layout,
though).

Fixes #464

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

No branches or pull requests

2 participants