mirror of
https://github.com/swaywm/sway.git
synced 2025-11-11 13:29:51 -05:00
Don't track damage for views on inactive tabs
This commit is contained in:
parent
bd79584f65
commit
efc07fb3d4
6 changed files with 52 additions and 11 deletions
|
|
@ -865,3 +865,28 @@ void view_update_marks_textures(struct sway_view *view) {
|
|||
&config->border_colors.urgent);
|
||||
container_damage_whole(view->swayc);
|
||||
}
|
||||
|
||||
bool view_is_visible(struct sway_view *view) {
|
||||
if (!view->swayc) {
|
||||
return false;
|
||||
}
|
||||
// Check view isn't in a tabbed or stacked container on an inactive tab
|
||||
struct sway_seat *seat = input_manager_current_seat(input_manager);
|
||||
struct sway_container *container = view->swayc;
|
||||
while (container->type != C_WORKSPACE) {
|
||||
if (container->parent->layout == L_TABBED ||
|
||||
container->parent->layout == L_STACKED) {
|
||||
if (seat_get_active_child(seat, container->parent) != container) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
container = container->parent;
|
||||
}
|
||||
// Check view isn't hidden by another fullscreen view
|
||||
struct sway_container *workspace = container;
|
||||
if (workspace->sway_workspace->fullscreen && !view->is_fullscreen) {
|
||||
return false;
|
||||
}
|
||||
// Check the workspace is visible
|
||||
return workspace_is_visible(workspace);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue