idle_inhibit: Ignore inhibitors when locked

When a session is locked, no views are visible and there is no way to
interact with the user session. This means that all inhibitors based on
visibility - with the exception being inhibitors on the session lock
surfaces themselves - become inert, allowing the session to go idle.

The only inhibitor type on normal views that one could argue should
remain active is INHIBIT_IDLE_OPEN, but for now we disable all view
inhibitors regardless of type.
This commit is contained in:
Kenny Levinsen 2024-05-23 14:34:24 +02:00 committed by Simon Ser
parent 8f089f0229
commit 5e6a6ea340
3 changed files with 25 additions and 0 deletions

View file

@ -218,6 +218,10 @@ uint32_t view_configure(struct sway_view *view, double lx, double ly, int width,
}
bool view_inhibit_idle(struct sway_view *view) {
if (server.session_lock.lock) {
return false;
}
struct sway_idle_inhibitor_v1 *user_inhibitor =
sway_idle_inhibit_v1_user_inhibitor_for_view(view);