diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-19 15:07:07 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-19 16:18:33 +1000 |
commit | 2b5a404ac920339a2b9ce32d4718272dee4668b9 (patch) | |
tree | 681f45a530a1f8d5966161291c3cb482e52edb6e /sway/input/cursor.c | |
parent | Merge pull request #2453 from ianyfan/commands (diff) | |
download | sway-2b5a404ac920339a2b9ce32d4718272dee4668b9.tar.gz sway-2b5a404ac920339a2b9ce32d4718272dee4668b9.tar.zst sway-2b5a404ac920339a2b9ce32d4718272dee4668b9.zip |
Replace hacky L_FLOATING container with a list
Workspaces previously had a magical `workspace->floating` container,
which had a layout of L_FLOATING and whose children were actual floating
views. This allowed some conveniences, but was a hacky solution because
the container has to be exempt from focus, coordinate transactions with
the workspace, and omit emitting IPC events (which we didn't do).
This commit changes it to be a list directly in the sway_workspace. The
L_FLOATING layout is no longer used so this has been removed as well.
* Fixes incorrect check in the swap command (it checked if the
containers had the L_FLOATING layout, but this layout applied to the
magical container).
* Introduces workspace_add_floating
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r-- | sway/input/cursor.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 762b8081..ba5e0400 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -724,7 +724,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
724 | uint32_t btn_move = config->floating_mod_inverse ? BTN_RIGHT : BTN_LEFT; | 724 | uint32_t btn_move = config->floating_mod_inverse ? BTN_RIGHT : BTN_LEFT; |
725 | if (button == btn_move && state == WLR_BUTTON_PRESSED && | 725 | if (button == btn_move && state == WLR_BUTTON_PRESSED && |
726 | (mod_pressed || on_titlebar)) { | 726 | (mod_pressed || on_titlebar)) { |
727 | while (cont->parent->layout != L_FLOATING) { | 727 | while (cont->parent->type != C_WORKSPACE) { |
728 | cont = cont->parent; | 728 | cont = cont->parent; |
729 | } | 729 | } |
730 | seat_begin_move(seat, cont, button); | 730 | seat_begin_move(seat, cont, button); |
@@ -746,7 +746,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
746 | BTN_LEFT : BTN_RIGHT; | 746 | BTN_LEFT : BTN_RIGHT; |
747 | if (mod_pressed && button == btn_resize) { | 747 | if (mod_pressed && button == btn_resize) { |
748 | struct sway_container *floater = cont; | 748 | struct sway_container *floater = cont; |
749 | while (floater->parent->layout != L_FLOATING) { | 749 | while (floater->parent->type != C_WORKSPACE) { |
750 | floater = floater->parent; | 750 | floater = floater->parent; |
751 | } | 751 | } |
752 | edge = 0; | 752 | edge = 0; |