Skip to content

Commit

Permalink
idle_inhibit: Check if layer surface output is enabled
Browse files Browse the repository at this point in the history
While we we cannot easily check for true visibility of layer surfaces as
easily as for views, we can check at least check that the output
associated with the surface is enabled.
  • Loading branch information
kennylevinsen committed Jul 10, 2024
1 parent 444017f commit 1a1bc78
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sway/desktop/idle_inhibit_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,13 @@ bool sway_idle_inhibit_v1_is_active(struct sway_idle_inhibitor_v1 *inhibitor) {
switch (inhibitor->mode) {
case INHIBIT_IDLE_APPLICATION:;
struct wlr_surface *wlr_surface = inhibitor->wlr_inhibitor->surface;
if (wlr_layer_surface_v1_try_from_wlr_surface(wlr_surface)) {
struct wlr_layer_surface_v1 *layer_surface =
wlr_layer_surface_v1_try_from_wlr_surface(wlr_surface);
if (layer_surface) {
// Layer surfaces can be occluded but are always on screen after
// they have been mapped.
return wlr_surface->mapped;
return layer_surface->output && layer_surface->output->enabled &&
wlr_surface->mapped;
}

// If there is no view associated with the inhibitor, assume invisible
Expand Down

0 comments on commit 1a1bc78

Please sign in to comment.