diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-20 09:11:55 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-21 20:16:56 +1000 |
commit | efc07fb3d45e07529e3817b4a1598f2c3256d600 (patch) | |
tree | 28a76416b5d3a50fa4db1c459e19a3f42c849d35 /sway/tree/view.c | |
parent | Add assertion in container_at_view (diff) | |
download | sway-efc07fb3d45e07529e3817b4a1598f2c3256d600.tar.gz sway-efc07fb3d45e07529e3817b4a1598f2c3256d600.tar.zst sway-efc07fb3d45e07529e3817b4a1598f2c3256d600.zip |
Don't track damage for views on inactive tabs
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 636abb25..51316507 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -865,3 +865,28 @@ void view_update_marks_textures(struct sway_view *view) { | |||
865 | &config->border_colors.urgent); | 865 | &config->border_colors.urgent); |
866 | container_damage_whole(view->swayc); | 866 | container_damage_whole(view->swayc); |
867 | } | 867 | } |
868 | |||
869 | bool view_is_visible(struct sway_view *view) { | ||
870 | if (!view->swayc) { | ||
871 | return false; | ||
872 | } | ||
873 | // Check view isn't in a tabbed or stacked container on an inactive tab | ||
874 | struct sway_seat *seat = input_manager_current_seat(input_manager); | ||
875 | struct sway_container *container = view->swayc; | ||
876 | while (container->type != C_WORKSPACE) { | ||
877 | if (container->parent->layout == L_TABBED || | ||
878 | container->parent->layout == L_STACKED) { | ||
879 | if (seat_get_active_child(seat, container->parent) != container) { | ||
880 | return false; | ||
881 | } | ||
882 | } | ||
883 | container = container->parent; | ||
884 | } | ||
885 | // Check view isn't hidden by another fullscreen view | ||
886 | struct sway_container *workspace = container; | ||
887 | if (workspace->sway_workspace->fullscreen && !view->is_fullscreen) { | ||
888 | return false; | ||
889 | } | ||
890 | // Check the workspace is visible | ||
891 | return workspace_is_visible(workspace); | ||
892 | } | ||