Skip to content

Commit

Permalink
idle_inhibit: Explicitly handle layer surfaces
Browse files Browse the repository at this point in the history
Layer surfaces do not have a view, and while they can be occluded they
are always visible on their associated output - assuming it is enabled.
  • Loading branch information
kennylevinsen committed Jun 10, 2024
1 parent df82d30 commit 93d534e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sway/desktop/idle_inhibit_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,15 @@ 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)) {
// Layer surfaces can be occluded but are always on screen after
// they have been mapped.
return wlr_surface->mapped;
}

// If there is no view associated with the inhibitor, assume visible
struct sway_view *view = view_from_wlr_surface(inhibitor->wlr_inhibitor->surface);
struct sway_view *view = view_from_wlr_surface(wlr_surface);
return !view || !view->container || view_is_visible(view);
case INHIBIT_IDLE_FOCUS:;
struct sway_seat *seat = NULL;
Expand Down

0 comments on commit 93d534e

Please sign in to comment.