Skip to content

Commit

Permalink
idle_inhibit: Assume view is invisible by default
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kennylevinsen committed Jun 10, 2024
1 parent 93d534e commit cce747c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sway/desktop/idle_inhibit_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit cce747c

Please sign in to comment.