aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar ash lea <example@thisismyactual.email>2021-04-02 20:14:01 -0700
committerLibravatar Ronan Pigott <rpigott@berkeley.edu>2021-04-15 16:58:27 -0700
commiteb9e77f4eae292da483191dcac18dbdfa50b984e (patch)
tree7e36fc5b3a9873b6023b3f325c25922548614154
parentmeson: libseat is no longer optional (diff)
downloadsway-eb9e77f4eae292da483191dcac18dbdfa50b984e.tar.gz
sway-eb9e77f4eae292da483191dcac18dbdfa50b984e.tar.zst
sway-eb9e77f4eae292da483191dcac18dbdfa50b984e.zip
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.c23
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) {
1039 } 1039 }
1040} 1040}
1041 1041
1042static void set_fullscreen_iterator(struct sway_container *con, void *data) { 1042static void set_fullscreen(struct sway_container *con, bool enable) {
1043 if (!con->view) { 1043 if (!con->view) {
1044 return; 1044 return;
1045 } 1045 }
1046 if (con->view->impl->set_fullscreen) { 1046 if (con->view->impl->set_fullscreen) {
1047 bool *enable = data; 1047 con->view->impl->set_fullscreen(con->view, enable);
1048 con->view->impl->set_fullscreen(con->view, *enable);
1049 if (con->view->foreign_toplevel) { 1048 if (con->view->foreign_toplevel) {
1050 wlr_foreign_toplevel_handle_v1_set_fullscreen( 1049 wlr_foreign_toplevel_handle_v1_set_fullscreen(
1051 con->view->foreign_toplevel, *enable); 1050 con->view->foreign_toplevel, enable);
1052 } 1051 }
1053 } 1052 }
1054} 1053}
@@ -1058,9 +1057,7 @@ static void container_fullscreen_workspace(struct sway_container *con) {
1058 "Expected a non-fullscreen container")) { 1057 "Expected a non-fullscreen container")) {
1059 return; 1058 return;
1060 } 1059 }
1061 bool enable = true; 1060 set_fullscreen(con, true);
1062 set_fullscreen_iterator(con, &enable);
1063 container_for_each_child(con, set_fullscreen_iterator, &enable);
1064 con->pending.fullscreen_mode = FULLSCREEN_WORKSPACE; 1061 con->pending.fullscreen_mode = FULLSCREEN_WORKSPACE;
1065 1062
1066 con->saved_x = con->pending.x; 1063 con->saved_x = con->pending.x;
@@ -1094,9 +1091,7 @@ static void container_fullscreen_global(struct sway_container *con) {
1094 "Expected a non-fullscreen container")) { 1091 "Expected a non-fullscreen container")) {
1095 return; 1092 return;
1096 } 1093 }
1097 bool enable = true; 1094 set_fullscreen(con, true);
1098 set_fullscreen_iterator(con, &enable);
1099 container_for_each_child(con, set_fullscreen_iterator, &enable);
1100 1095
1101 root->fullscreen_global = con; 1096 root->fullscreen_global = con;
1102 con->saved_x = con->pending.x; 1097 con->saved_x = con->pending.x;
@@ -1122,9 +1117,7 @@ void container_fullscreen_disable(struct sway_container *con) {
1122 "Expected a fullscreen container")) { 1117 "Expected a fullscreen container")) {
1123 return; 1118 return;
1124 } 1119 }
1125 bool enable = false; 1120 set_fullscreen(con, false);
1126 set_fullscreen_iterator(con, &enable);
1127 container_for_each_child(con, set_fullscreen_iterator, &enable);
1128 1121
1129 if (container_is_floating(con)) { 1122 if (container_is_floating(con)) {
1130 con->pending.x = con->saved_x; 1123 con->pending.x = con->saved_x;
@@ -1388,10 +1381,6 @@ void container_add_child(struct sway_container *parent,
1388 child->pending.parent = parent; 1381 child->pending.parent = parent;
1389 child->pending.workspace = parent->pending.workspace; 1382 child->pending.workspace = parent->pending.workspace;
1390 container_for_each_child(child, set_workspace, NULL); 1383 container_for_each_child(child, set_workspace, NULL);
1391 bool fullscreen = child->pending.fullscreen_mode != FULLSCREEN_NONE ||
1392 parent->pending.fullscreen_mode != FULLSCREEN_NONE;
1393 set_fullscreen_iterator(child, &fullscreen);
1394 container_for_each_child(child, set_fullscreen_iterator, &fullscreen);
1395 container_handle_fullscreen_reparent(child); 1384 container_handle_fullscreen_reparent(child);
1396 container_update_representation(parent); 1385 container_update_representation(parent);
1397 node_set_dirty(&child->node); 1386 node_set_dirty(&child->node);