shell: Disarm the screensaver timeout timer on terminate_screensaver()
The timer was left running after the screensaver was terminated. When
it triggered, a fade out that would in turn cause the screen to be
locked was started. Since that could happen without the compositor
emitting the idle signal, there would be no wake signal to make the
shell show the lock screen, so the system was left unresponsive
until the idle signal actually triggered.
https://bugs.freedesktop.org/show_bug.cgi?id=70923
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index a6f8a76..0fa59de 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -3741,6 +3741,12 @@
if (shell->screensaver.process.pid == 0)
return;
+ /* Disarm the screensaver timer, otherwise it may fire when the
+ * compositor is not in the idle state. In that case, the screen will
+ * be locked, but the wake_signal won't fire on user input, making the
+ * system unresponsive. */
+ wl_event_source_timer_update(shell->screensaver.timer, 0);
+
kill(shell->screensaver.process.pid, SIGTERM);
}