The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
1

Workspace can only be a split container: why?

asked 2014-07-06 11:52:31 +0000

Hibou57 gravatar image

updated 2014-07-10 11:59:17 +0000

Unless I'm wrong, seems there is no way to give a workspace, a layout of tabbed or stacked.

With the help of i3-msg -t get_tree, I could determine whenever I try to give a workspace, one of these two latter layouts, an intermediate container is created instead, with the requested layout. So seems a workspace can present two layouts only: splith or splitv.

I would just like to know why, as I don't guess what could prevent a workspace to be tabbed or stacked, directly.

Example case

  • Go to a new empty workspace;
  • Press $mod+w (for English layout keyboard) to give it a tabbed layout;
  • Press $mod+Enter to open a new terminal;
  • Repeat two more times;
  • You have three terminals, the focused one is the rightmost one;
  • Press $mod+Shift+Right : the terminal goes to a parent split container.

The workspace is not the tabbed container, a child container is, and the workspace is an horizontal split container.

Introspection case

Each introspection of a state is given as an indented tree, generated using i3-msg -t get_tree. For readability, the root and __i3 nodes are not shown. The fields shown in the tree, are, in that order: name, layout, and type.

Introspection of a workspace with tabbed layout

Initial, with one terminal opened:

LVDS1|output|output|
   topdock|dockarea|dockarea|
   content|splith|con|
      1:test|splith|workspace|
         Terminal|splith|con|
   bottomdock|dockarea|dockarea|
      i3bar for output LVDS1|splith|con|

After switching to tabbed layout:

LVDS1|output|output|
   topdock|dockarea|dockarea|
   content|splith|con|
      1:test|splith|workspace|
         #00FF00|tabbed|con|
            Terminal|splith|con|
   bottomdock|dockarea|dockarea|
      i3bar for output LVDS1|splith|con|

Note the unexpected additional “anonymous” container which appeared, named #00FF00. Its layout is tabbed, the workspace keeps its splith layout.

After a new terminal is opened:

LVDS1|output|output|
   topdock|dockarea|dockarea|
   content|splith|con|
      1:test|splith|workspace|
         #00FF00|tabbed|con|
            Terminal|splith|con|
            Terminal|splith|con|
   bottomdock|dockarea|dockarea|
      i3bar for output LVDS1|splith|con|

The terminal is created in the new #00FF00 container.

Introspection of a workspace with split layout

Initial, with one terminal opened:

LVDS1|output|output|
   topdock|dockarea|dockarea|
   content|splith|con|
      1:test|splith|workspace|
         Terminal|splith|con|
   bottomdock|dockarea|dockarea|
      i3bar for output LVDS1|splith|con|

After switching to splith layout:

LVDS1|output|output|
   topdock|dockarea|dockarea|
   content|splith|con|
      1:test|splith|workspace|
         Terminal|splith|con|
   bottomdock|dockarea|dockarea|
      i3bar for output LVDS1|splith|con|

Note no additional anonymous container is created in this case.

After a new terminal is opened:

LVDS1|output|output|
   topdock|dockarea|dockarea|
   content|splith|con|
      1:test|splith|workspace|
         Terminal|splith|con|
         Terminal|splith|con|
   bottomdock|dockarea|dockarea|
      i3bar for output LVDS1|splith|con|

The parent of the new terminal is just the workspace (as expected), not an intermediate container.

The same when switching splitv, there is not additional container created (this case is not shown here, for readability).

Conclusion

An anonymous container is created only when switching the workspace layout to tabbed ... (more)

edit retag flag offensive close merge delete

Comments

Workspaces do not have layouts. The space within a workspace is call a container, which you can change the layout to splitv, splith, stacked or tabbed. You probably need to rephrase your question as it is not very clear. Could you made an example, you may want to include a diagram of text characters

phairland gravatar imagephairland ( 2014-07-06 18:21:14 +0000 )edit
1

@phairland, I added an example case.

Hibou57 gravatar imageHibou57 ( 2014-07-07 17:34:09 +0000 )edit

1 answer

Sort by » oldest newest most voted
3

answered 2014-07-09 18:47:46 +0000

ANOKNUSA gravatar image

updated 2014-07-09 18:51:04 +0000

"Press $mod+Shift+Right : the terminal goes to a parent split container."

Wrong. A "workspace" is really just a particular collection of windows/containers on the screen. As phairland stated, a workspace doesn't have a layout itself, because the workspace itself is not a container.

A workspace starts with an invisible container. When a window is opened on the empty workspace, that window is drawn within the top-most parent container on the workspace. That container has a layout---tabbed, stacked or split (depending on the default you've set in your configuration file). When you open more windows within that container they abide by the layout you've set. Once you move a window out of that container it does not move to a split container, but a second parent container is created for it, to be placed next to, above or below its previous parent. Simply put: The window does not go to a parent split container---it becomes a parent container, and has whatever layout you give it.

What you seem to be asking is "Why can't I just have everything be tabbed containers?" The answer is that you can: Just create nested tabbed containers within the current parent. As soon as you remove a window from the top-most parent container a new parent container is created for it. Not only does this make sense, but doing the opposite (forcing assigned layouts on workspaces) would negate the whole point of manual tiling. Think about it: If a workspace has an assigned tabbed layout, what does the window manager do when I try to move a window upward or downward out of its parent container?

edit flag offensive delete link more

Comments

I added cases introspection in the original post, to make the matter more clear.

Hibou57 gravatar imageHibou57 ( 2014-07-10 11:50:19 +0000 )edit
1

This doesn't really clarify what it is you're asking (or rather, *why* you're asking). I won't pretend to understand exactly how the i3 data tree works, but again: How would having a strict tabbed layout for a workspace be beneficial? It seems it would certainly interfere with manual layout control.

ANOKNUSA gravatar imageANOKNUSA ( 2014-07-10 13:30:36 +0000 )edit

Question Tools

Stats

Asked: 2014-07-06 11:52:31 +0000

Seen: 507 times

Last updated: Jul 10 '14