From ff8fbc3e2b896162eaefa030eb4f20f7e011cd0f Mon Sep 17 00:00:00 2001 From: Faye Duxovni Date: Tue, 18 Jan 2022 05:05:28 -0500 Subject: [PATCH 1/2] Make sure pending resume commands still get run regardless of logind idle inhibitors --- main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 0c86f912..40ba8192 100644 --- a/main.c +++ b/main.c @@ -623,7 +623,9 @@ static void enable_timeouts(void) { state.timeouts_enabled = true; struct swayidle_timeout_cmd *cmd; wl_list_for_each(cmd, &state.timeout_cmds, link) { - register_timeout(cmd, cmd->timeout); + if (cmd->idle_timer == NULL || !cmd->resume_pending) { + register_timeout(cmd, cmd->timeout); + } } } @@ -637,7 +639,9 @@ static void disable_timeouts(void) { state.timeouts_enabled = false; struct swayidle_timeout_cmd *cmd; wl_list_for_each(cmd, &state.timeout_cmds, link) { - destroy_cmd_timer(cmd); + if (!cmd->resume_pending) { + destroy_cmd_timer(cmd); + } } if (state.logind_idlehint) { set_idle_hint(false); @@ -661,7 +665,9 @@ static void handle_idled(struct swayidle_timeout_cmd *cmd) { static void handle_resumed(struct swayidle_timeout_cmd *cmd) { cmd->resume_pending = false; swayidle_log(LOG_DEBUG, "active state"); - if (cmd->registered_timeout != cmd->timeout) { + if (!state.timeouts_enabled) { + destroy_cmd_timer(cmd); + } else if (cmd->registered_timeout != cmd->timeout) { register_timeout(cmd, cmd->timeout); } #if HAVE_SYSTEMD || HAVE_ELOGIND From 68852dc823b4499af5d6d3e4c8a8d13e01e10326 Mon Sep 17 00:00:00 2001 From: Faye Duxovni Date: Thu, 5 Jan 2023 02:37:40 -0500 Subject: [PATCH 2/2] Update PR for ext-idle-notify-v1 --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 40ba8192..88ad2605 100644 --- a/main.c +++ b/main.c @@ -623,7 +623,7 @@ static void enable_timeouts(void) { state.timeouts_enabled = true; struct swayidle_timeout_cmd *cmd; wl_list_for_each(cmd, &state.timeout_cmds, link) { - if (cmd->idle_timer == NULL || !cmd->resume_pending) { + if ((cmd->idle_notification == NULL && cmd->kde_idle_timer == NULL) || !cmd->resume_pending) { register_timeout(cmd, cmd->timeout); } }