diff options
author | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-04-20 00:22:15 +0200 |
---|---|---|
committer | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-04-25 00:00:49 +0200 |
commit | 3e1f78ab26e8bc6b6cefd53ee137e97533c2695e (patch) | |
tree | f158bcae9fce9af29a35bd3ec0e32b81bff87662 /sway/commands.c | |
parent | Use tabs for indentation (diff) | |
download | sway-3e1f78ab26e8bc6b6cefd53ee137e97533c2695e.tar.gz sway-3e1f78ab26e8bc6b6cefd53ee137e97533c2695e.tar.zst sway-3e1f78ab26e8bc6b6cefd53ee137e97533c2695e.zip |
Add support for nested tabbed/stacked containers
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c index ad5416f7..ff1ddc5b 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -1759,6 +1759,8 @@ static struct cmd_results *cmd_layout(int argc, char **argv) { | |||
1759 | parent = parent->parent; | 1759 | parent = parent->parent; |
1760 | } | 1760 | } |
1761 | 1761 | ||
1762 | enum swayc_layouts old_layout = parent->layout; | ||
1763 | |||
1762 | if (strcasecmp(argv[0], "default") == 0) { | 1764 | if (strcasecmp(argv[0], "default") == 0) { |
1763 | parent->layout = parent->prev_layout; | 1765 | parent->layout = parent->prev_layout; |
1764 | if (parent->layout == L_NONE) { | 1766 | if (parent->layout == L_NONE) { |
@@ -1795,6 +1797,8 @@ static struct cmd_results *cmd_layout(int argc, char **argv) { | |||
1795 | } | 1797 | } |
1796 | } | 1798 | } |
1797 | 1799 | ||
1800 | update_layout_geometry(parent, old_layout); | ||
1801 | |||
1798 | arrange_windows(parent, parent->width, parent->height); | 1802 | arrange_windows(parent, parent->width, parent->height); |
1799 | 1803 | ||
1800 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 1804 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
@@ -2032,6 +2036,7 @@ static struct cmd_results *_do_split(int argc, char **argv, int layout) { | |||
2032 | /* regular case where new split container is build around focused container | 2036 | /* regular case where new split container is build around focused container |
2033 | * or in case of workspace, container inherits its children */ | 2037 | * or in case of workspace, container inherits its children */ |
2034 | sway_log(L_DEBUG, "Adding new container around current focused container"); | 2038 | sway_log(L_DEBUG, "Adding new container around current focused container"); |
2039 | sway_log(L_INFO, "FOCUSED SIZE: %.f %.f", focused->width, focused->height); | ||
2035 | swayc_t *parent = new_container(focused, layout); | 2040 | swayc_t *parent = new_container(focused, layout); |
2036 | set_focused_container(focused); | 2041 | set_focused_container(focused); |
2037 | arrange_windows(parent, -1, -1); | 2042 | arrange_windows(parent, -1, -1); |