Skip to content

Commit cc48222

Browse files
kennylevinsenemersion
authored andcommitted
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.
1 parent 541183b commit cc48222

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sway/desktop/idle_inhibit_v1.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ bool sway_idle_inhibit_v1_is_active(struct sway_idle_inhibitor_v1 *inhibitor) {
126126
return wlr_surface->mapped;
127127
}
128128

129-
// If there is no view associated with the inhibitor, assume visible
129+
// If there is no view associated with the inhibitor, assume invisible
130130
struct sway_view *view = view_from_wlr_surface(wlr_surface);
131-
return !view || !view->container || view_is_visible(view);
131+
return view && view->container && view_is_visible(view);
132132
case INHIBIT_IDLE_FOCUS:;
133133
struct sway_seat *seat = NULL;
134134
wl_list_for_each(seat, &server.input->seats, link) {

0 commit comments

Comments
 (0)