aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2024-06-11 00:12:02 +0200
committerFurkan Sahin <furkan-dev@proton.me>2024-06-11 00:12:02 +0200
commit59a412ad3760199f88ead6fcb6d3432189a98905 (patch)
treec7e1d8e70af39ad0c5b3c03e65c4c8cce41c18e4
parent72f263a887d9950d14d233a04374ebecf0e6b9cd (diff)
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.
-rw-r--r--sway/desktop/idle_inhibit_v1.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sway/desktop/idle_inhibit_v1.c b/sway/desktop/idle_inhibit_v1.c
index 9fc223d0..b495c204 100644
--- a/sway/desktop/idle_inhibit_v1.c
+++ b/sway/desktop/idle_inhibit_v1.c
@@ -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