Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_notification == NULL && cmd->kde_idle_timer == NULL) || !cmd->resume_pending) {
register_timeout(cmd, cmd->timeout);
}
}
}

Expand All @@ -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);
Expand All @@ -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
Expand Down