aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-28 17:02:35 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-28 17:02:35 +1000
commit22412f57b06b1b344de0a5ccf2172b7bd10eadb9 (patch)
treeadade49d798690cb5d47bd536432de40d4cbbcea /sway/tree/view.c
parentMerge pull request #2717 from ianyfan/tablet-config (diff)
downloadsway-22412f57b06b1b344de0a5ccf2172b7bd10eadb9.tar.gz
sway-22412f57b06b1b344de0a5ccf2172b7bd10eadb9.tar.zst
sway-22412f57b06b1b344de0a5ccf2172b7bd10eadb9.zip
Fix floating views in tabbed/stacked workspaces not getting frame events
view_is_visible would return false, which meant the view wouldn't receive a frame done event. view_is_visible needs to make an exception for floating containers. This also moves the workspace_is_visible check to an earlier location for performance reasons.
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index e370443c..a024f325 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -989,12 +989,16 @@ bool view_is_visible(struct sway_view *view) {
989 floater = floater->parent; 989 floater = floater->parent;
990 } 990 }
991 bool is_sticky = container_is_floating(floater) && floater->is_sticky; 991 bool is_sticky = container_is_floating(floater) && floater->is_sticky;
992 if (!is_sticky && !workspace_is_visible(workspace)) {
993 return false;
994 }
992 // Check view isn't in a tabbed or stacked container on an inactive tab 995 // Check view isn't in a tabbed or stacked container on an inactive tab
993 struct sway_seat *seat = input_manager_current_seat(input_manager); 996 struct sway_seat *seat = input_manager_current_seat(input_manager);
994 struct sway_container *con = view->container; 997 struct sway_container *con = view->container;
995 while (con) { 998 while (con) {
996 enum sway_container_layout layout = container_parent_layout(con); 999 enum sway_container_layout layout = container_parent_layout(con);
997 if (layout == L_TABBED || layout == L_STACKED) { 1000 if ((layout == L_TABBED || layout == L_STACKED)
1001 && !container_is_floating(con)) {
998 struct sway_node *parent = con->parent ? 1002 struct sway_node *parent = con->parent ?
999 &con->parent->node : &con->workspace->node; 1003 &con->parent->node : &con->workspace->node;
1000 if (seat_get_active_tiling_child(seat, parent) != &con->node) { 1004 if (seat_get_active_tiling_child(seat, parent) != &con->node) {
@@ -1008,10 +1012,6 @@ bool view_is_visible(struct sway_view *view) {
1008 !container_is_fullscreen_or_child(view->container)) { 1012 !container_is_fullscreen_or_child(view->container)) {
1009 return false; 1013 return false;
1010 } 1014 }
1011 // Check the workspace is visible
1012 if (!is_sticky) {
1013 return workspace_is_visible(workspace);
1014 }
1015 return true; 1015 return true;
1016} 1016}
1017 1017