-
Notifications
You must be signed in to change notification settings - Fork 769
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
Allow splitting into any kind of layout #4208
base: next
Are you sure you want to change the base?
Conversation
There seem to be a broken test related to
Can revert the bahavior or fix the test, depending on which behavior is desired. |
So, the behavior of |
It is not, it only affects splits. |
Sounds good, this will also fix #3001. Can you fix the test and include new ones that test the new behavior please? |
Sorry, short on time right away, will do this next week |
Thanks for taking a stab at implementing this! ❤️ This fixes one of the annoyances I've had with i3's windowing. What follows is a patch that is better handled in a separate PRHere is a patch that draws indicators for the new splits (as it already does for horizontal and vertical). For stacked, it draws the indicator over the top border, mirroring the vertical split indicator. I don't this think will be confused with the vertical split as that will always split at the bottom (as far as I know), opposite of where the stacked split indicator would be drawn. The tabbed indicator also draws over the top border, but only for half the width, sort of mimicking a tab.diff --git a/src/x.c b/src/x.c
index def79ef2..5348764c 100644
--- a/src/x.c
+++ b/src/x.c
@@ -588,6 +588,12 @@ void x_draw_decoration(Con *con) {
} else if (p->parent_layout == L_SPLITV) {
draw_util_rectangle(&(con->frame_buffer), p->color->indicator,
br.x, r->height + (br.height + br.y), r->width + br.width, -(br.height + br.y));
+ } else if (p->parent_layout == L_STACKED) {
+ draw_util_rectangle(&(con->frame_buffer), p->color->indicator,
+ br.x, br.y, r->width + br.width, br.height);
+ } else if (p->parent_layout == L_TABBED) {
+ draw_util_rectangle(&(con->frame_buffer), p->color->indicator,
+ br.x, br.y, (r->width + br.width) / 2, br.height);
}
}
}
Here is a preview with increased border size. Tabbed split is on the left, and stacked on the right: |
Huh, I totally forgot to check if this has been discussed before. Though I'm not surprised that it has. |
This should solve #4207, I've successfully tested this as a patch to 4.18.2.
This change introduces
tabbed
,stacking
,stacked
modes tosplit
command in a backward compatible way (t
still works astoggle
).Additionaly, this changes behavior which replaces the layout of current container (instead of creating a nested container) if the container only has one child: while before it only worked for splits, now it works for all layouts which is IMO more consistent.
Fixes #4207
Closes #3001