diff --git a/sway/desktop/idle_inhibit_v1.c b/sway/desktop/idle_inhibit_v1.c index a6ad7166..82353038 100644 --- a/sway/desktop/idle_inhibit_v1.c +++ b/sway/desktop/idle_inhibit_v1.c @@ -69,8 +69,8 @@ struct sway_idle_inhibitor_v1 *sway_idle_inhibit_v1_user_inhibitor_for_view( struct sway_idle_inhibitor_v1 *inhibitor; wl_list_for_each(inhibitor, &server.idle_inhibit_manager_v1->inhibitors, link) { - if (inhibitor->view == view && - inhibitor->mode != INHIBIT_IDLE_APPLICATION) { + if (inhibitor->mode != INHIBIT_IDLE_APPLICATION && + inhibitor->view == view) { return inhibitor; } } @@ -82,8 +82,8 @@ struct sway_idle_inhibitor_v1 *sway_idle_inhibit_v1_application_inhibitor_for_vi struct sway_idle_inhibitor_v1 *inhibitor; wl_list_for_each(inhibitor, &server.idle_inhibit_manager_v1->inhibitors, link) { - if (inhibitor->view == view && - inhibitor->mode == INHIBIT_IDLE_APPLICATION) { + if (inhibitor->mode == INHIBIT_IDLE_APPLICATION && + view_from_wlr_surface(inhibitor->wlr_inhibitor->surface) == view) { return inhibitor; } }