[PATCH] shell: Set the DPMS state if the screensaver fails to launch or dies

Ander Conselvan de Oliveira conselvan2 at gmail.com
Fri Feb 15 08:44:19 PST 2013


From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>

The lock hook in desktop-shell only changes the DPMS state the second
time it is called, because during the first time it launches the
screensaver and wakes the compositor again when the screensaver surface
is configured. However, if the screensaver fails to launch, the output
is left in an enabled state, even thought there's no content being
displayed on the screen.

Fix this by disabling the outputs when the screensaver dies if the
shell is still locked.

https://bugs.freedesktop.org/show_bug.cgi?id=60084
---
 src/shell.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/shell.c b/src/shell.c
index dcbabf3..8d89bc2 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -2085,7 +2085,16 @@ static const struct wl_shell_interface shell_implementation = {
 static void
 handle_screensaver_sigchld(struct weston_process *proc, int status)
 {
+	struct desktop_shell *shell =
+		container_of(proc, struct desktop_shell, screensaver.process);
+	struct weston_output *output;
+
 	proc->pid = 0;
+
+	if (shell->locked)
+		wl_list_for_each(output, &shell->compositor->output_list, link)
+			if (output->set_dpms)
+				output->set_dpms(output, WESTON_DPMS_STANDBY);
 }
 
 static void
-- 
1.7.9.5



More information about the wayland-devel mailing list