aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-12-15 21:35:20 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-12-16 12:01:42 -0500
commit0278c4db6f7334b02ae824434ef52abab342b900 (patch)
tree45cd9ae68c2a1b58797fc379972cd97f2dffcc8b
parentconfig/input: set type for new identifier configs (diff)
downloadsway-0278c4db6f7334b02ae824434ef52abab342b900.tar.gz
sway-0278c4db6f7334b02ae824434ef52abab342b900.tar.zst
sway-0278c4db6f7334b02ae824434ef52abab342b900.zip
root_scratchpad_hide: disable fullscreen descendants
Any descendant of a scratchpad container may be fullscreen so checking to see if the top-level scratchpad container is fullscreen in root_scratchpad_hide is not sufficient. This iterates through all descendants of the scratchpad container
-rw-r--r--sway/tree/root.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sway/tree/root.c b/sway/tree/root.c
index 6759b6cf..a3830976 100644
--- a/sway/tree/root.c
+++ b/sway/tree/root.c
@@ -149,6 +149,12 @@ void root_scratchpad_show(struct sway_container *con) {
149 seat_set_focus(seat, seat_get_focus_inactive(seat, &con->node)); 149 seat_set_focus(seat, seat_get_focus_inactive(seat, &con->node));
150} 150}
151 151
152static void disable_fullscreen(struct sway_container *con, void *data) {
153 if (con->fullscreen_mode != FULLSCREEN_NONE) {
154 container_fullscreen_disable(con);
155 }
156}
157
152void root_scratchpad_hide(struct sway_container *con) { 158void root_scratchpad_hide(struct sway_container *con) {
153 struct sway_seat *seat = input_manager_current_seat(); 159 struct sway_seat *seat = input_manager_current_seat();
154 struct sway_node *focus = seat_get_focus_inactive(seat, &root->node); 160 struct sway_node *focus = seat_get_focus_inactive(seat, &root->node);
@@ -160,9 +166,8 @@ void root_scratchpad_hide(struct sway_container *con) {
160 return; 166 return;
161 } 167 }
162 168
163 if (con->fullscreen_mode != FULLSCREEN_NONE) { 169 disable_fullscreen(con, NULL);
164 container_fullscreen_disable(con); 170 container_for_each_child(con, disable_fullscreen, NULL);
165 }
166 container_detach(con); 171 container_detach(con);
167 arrange_workspace(ws); 172 arrange_workspace(ws);
168 if (&con->node == focus || node_has_ancestor(focus, &con->node)) { 173 if (&con->node == focus || node_has_ancestor(focus, &con->node)) {