diff options
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/idle_inhibit_v1.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sway/desktop/idle_inhibit_v1.c b/sway/desktop/idle_inhibit_v1.c index a5cfd5b2..a6ad7166 100644 --- a/sway/desktop/idle_inhibit_v1.c +++ b/sway/desktop/idle_inhibit_v1.c @@ -36,7 +36,7 @@ void handle_idle_inhibitor_v1(struct wl_listener *listener, void *data) { inhibitor->manager = manager; inhibitor->mode = INHIBIT_IDLE_APPLICATION; - inhibitor->view = view_from_wlr_surface(wlr_inhibitor->surface); + inhibitor->wlr_inhibitor = wlr_inhibitor; wl_list_insert(&manager->inhibitors, &inhibitor->link); inhibitor->destroy.notify = handle_destroy; @@ -104,10 +104,10 @@ void sway_idle_inhibit_v1_user_inhibitor_destroy( bool sway_idle_inhibit_v1_is_active(struct sway_idle_inhibitor_v1 *inhibitor) { switch (inhibitor->mode) { - case INHIBIT_IDLE_APPLICATION: + case INHIBIT_IDLE_APPLICATION:; // If there is no view associated with the inhibitor, assume visible - return !inhibitor->view || !inhibitor->view->container || - view_is_visible(inhibitor->view); + struct sway_view *view = view_from_wlr_surface(inhibitor->wlr_inhibitor->surface); + 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) { |