aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2024-05-23 15:01:46 +0200
committerFurkan Sahin <furkan-dev@proton.me>2024-05-23 15:01:46 +0200
commit05ce969a477f1bcc153392eaa061b683379d4486 (patch)
tree78f92872eca09af15593e43bae0f010a6798c7fa
parent61dbaa7b8243f6868f9f900b0113136a48cd9be4 (diff)
idle_inhibit: Explicitly handle layer surfaces
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.
-rw-r--r--sway/desktop/idle_inhibit_v1.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sway/desktop/idle_inhibit_v1.c b/sway/desktop/idle_inhibit_v1.c
index d241cdaf..0fc79989 100644
--- a/sway/desktop/idle_inhibit_v1.c
+++ b/sway/desktop/idle_inhibit_v1.c
@@ -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;