compositor: let the shell wake up the compositor
When compositor enters SLEEPING state, the shell plugin goes locked. If
compositor wakes up itself, it will fade in while the shell may not yet
have a lock surface to show.
Fix this by assigning wake-up to be called from the shell, if the
compositor is SLEEPING. The shell may wait for the lock surface request,
and only then wake up the compositor. The compositor will fade in
directly to the lock screen.
krh: original patch for compositor.c
ppaalanen: integration and shell.c changes
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
diff --git a/compositor/shell.c b/compositor/shell.c
index 9d22cde..c25ada2 100644
--- a/compositor/shell.c
+++ b/compositor/shell.c
@@ -829,6 +829,11 @@
struct wl_resource *resource,
struct wl_resource *surface_resource)
{
+ struct wl_shell *shell = resource->data;
+
+ /* TODO: put the lock surface always on top modal until unlocked */
+
+ wlsc_compositor_wake(shell->compositor);
}
static void
@@ -839,6 +844,7 @@
shell->locked = false;
shell->prepare_event_sent = false;
+ wlsc_compositor_wake(shell->compositor);
}
static const struct desktop_shell_interface desktop_shell_implementation = {
@@ -952,6 +958,7 @@
/* If desktop-shell client has gone away, unlock immediately. */
if (!shell->child.desktop_shell) {
shell->locked = false;
+ wlsc_compositor_wake(shell->compositor);
return;
}