diff options
author | ash lea <example@thisismyactual.email> | 2021-04-02 20:14:01 -0700 |
---|---|---|
committer | Ronan Pigott <rpigott@berkeley.edu> | 2021-04-15 16:58:27 -0700 |
commit | eb9e77f4eae292da483191dcac18dbdfa50b984e (patch) | |
tree | 7e36fc5b3a9873b6023b3f325c25922548614154 | |
parent | 4e77bc293515ea2f00ebbc4395cb0eb4446d0195 (diff) |
container: don't set fullscreen on children
the original behavior set fullscreen for all descendents of a container,
which causes issues when firefox is one of those children because it
sends its own set_fullscreen request in response to being fullscreened.
-rw-r--r-- | sway/tree/container.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 67e69d9d..43fe6944 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -1039,16 +1039,15 @@ void container_end_mouse_operation(struct sway_container *container) { } } -static void set_fullscreen_iterator(struct sway_container *con, void *data) { +static void set_fullscreen(struct sway_container *con, bool enable) { if (!con->view) { return; } if (con->view->impl->set_fullscreen) { - bool *enable = data; - con->view->impl->set_fullscreen(con->view, *enable); + con->view->impl->set_fullscreen(con->view, enable); if (con->view->foreign_toplevel) { wlr_foreign_toplevel_handle_v1_set_fullscreen( - con->view->foreign_toplevel, *enable); + con->view->foreign_toplevel, enable); } } } @@ -1058,9 +1057,7 @@ static void container_fullscreen_workspace(struct sway_container *con) { "Expected a non-fullscreen container")) { return; } - bool enable = true; - set_fullscreen_iterator(con, &enable); - container_for_each_child(con, set_fullscreen_iterator, &enable); + set_fullscreen(con, true); con->pending.fullscreen_mode = FULLSCREEN_WORKSPACE; con->saved_x = con->pending.x; @@ -1094,9 +1091,7 @@ static void container_fullscreen_global(struct sway_container *con) { "Expected a non-fullscreen container")) { return; } - bool enable = true; - set_fullscreen_iterator(con, &enable); - container_for_each_child(con, set_fullscreen_iterator, &enable); + set_fullscreen(con, true); root->fullscreen_global = con; con->saved_x = con->pending.x; @@ -1122,9 +1117,7 @@ void container_fullscreen_disable(struct sway_container *con) { "Expected a fullscreen container")) { return; } - bool enable = false; - set_fullscreen_iterator(con, &enable); - container_for_each_child(con, set_fullscreen_iterator, &enable); + set_fullscreen(con, false); if (container_is_floating(con)) { con->pending.x = con->saved_x; @@ -1388,10 +1381,6 @@ void container_add_child(struct sway_container *parent, child->pending.parent = parent; child->pending.workspace = parent->pending.workspace; container_for_each_child(child, set_workspace, NULL); - bool fullscreen = child->pending.fullscreen_mode != FULLSCREEN_NONE || - parent->pending.fullscreen_mode != FULLSCREEN_NONE; - set_fullscreen_iterator(child, &fullscreen); - container_for_each_child(child, set_fullscreen_iterator, &fullscreen); container_handle_fullscreen_reparent(child); container_update_representation(parent); node_set_dirty(&child->node); |