aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2019-12-15 21:35:20 -0500
committerDrew DeVault <sir@cmpwn.com>2019-12-16 12:01:42 -0500
commit0278c4db6f7334b02ae824434ef52abab342b900 (patch)
tree45cd9ae68c2a1b58797fc379972cd97f2dffcc8b
parent218b5b9dc0f90693be0a77f0bd3001f1912b86aa (diff)
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) {
seat_set_focus(seat, seat_get_focus_inactive(seat, &con->node));
}
+static void disable_fullscreen(struct sway_container *con, void *data) {
+ if (con->fullscreen_mode != FULLSCREEN_NONE) {
+ container_fullscreen_disable(con);
+ }
+}
+
void root_scratchpad_hide(struct sway_container *con) {
struct sway_seat *seat = input_manager_current_seat();
struct sway_node *focus = seat_get_focus_inactive(seat, &root->node);
@@ -160,9 +166,8 @@ void root_scratchpad_hide(struct sway_container *con) {
return;
}
- if (con->fullscreen_mode != FULLSCREEN_NONE) {
- container_fullscreen_disable(con);
- }
+ disable_fullscreen(con, NULL);
+ container_for_each_child(con, disable_fullscreen, NULL);
container_detach(con);
arrange_workspace(ws);
if (&con->node == focus || node_has_ancestor(focus, &con->node)) {