Skip to content

Commit 583862e

Browse files
kennylevinsenemersion
authored andcommitted
idle_inhibit: Check if layer surface output is enabled
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.
1 parent cc48222 commit 583862e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sway/desktop/idle_inhibit_v1.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,13 @@ bool sway_idle_inhibit_v1_is_active(struct sway_idle_inhibitor_v1 *inhibitor) {
120120
switch (inhibitor->mode) {
121121
case INHIBIT_IDLE_APPLICATION:;
122122
struct wlr_surface *wlr_surface = inhibitor->wlr_inhibitor->surface;
123-
if (wlr_layer_surface_v1_try_from_wlr_surface(wlr_surface)) {
123+
struct wlr_layer_surface_v1 *layer_surface =
124+
wlr_layer_surface_v1_try_from_wlr_surface(wlr_surface);
125+
if (layer_surface) {
124126
// Layer surfaces can be occluded but are always on screen after
125127
// they have been mapped.
126-
return wlr_surface->mapped;
128+
return layer_surface->output && layer_surface->output->enabled &&
129+
wlr_surface->mapped;
127130
}
128131

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

0 commit comments

Comments
 (0)