summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2024-05-23 15:03:44 +0200
committerFurkan Sahin <furkan-dev@proton.me>2024-05-23 15:03:44 +0200
commit72f263a887d9950d14d233a04374ebecf0e6b9cd (patch)
treecc1f3e328480e28ef0fd0249d7eb8b0e08c85877
parent05ce969a477f1bcc153392eaa061b683379d4486 (diff)
idle_inhibit: Assume view is invisible by default
We have historically considered surfaces without a view visible. This made sense in case of layer surfaces which do not have a view, but it also allows unmapped surfaces to act as global inhibitors irrespective of the current view state, which is not the intention fo the protocol. As we now explicitly handle layer surfaces, assume that views are only visible if they can be found and their visibility checked.
-rw-r--r--sway/desktop/idle_inhibit_v1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/desktop/idle_inhibit_v1.c b/sway/desktop/idle_inhibit_v1.c
index 0fc79989..9fc223d0 100644
--- a/sway/desktop/idle_inhibit_v1.c
+++ b/sway/desktop/idle_inhibit_v1.c
@@ -126,9 +126,9 @@ bool sway_idle_inhibit_v1_is_active(struct sway_idle_inhibitor_v1 *inhibitor) {
return wlr_surface->mapped;
}
- // If there is no view associated with the inhibitor, assume visible
+ // If there is no view associated with the inhibitor, assume invisible
struct sway_view *view = view_from_wlr_surface(wlr_surface);
- return !view || !view->container || view_is_visible(view);
+ return view && view->container && view_is_visible(view);
case INHIBIT_IDLE_FOCUS:;
struct sway_seat *seat = NULL;
wl_list_for_each(seat, &server.input->seats, link) {