When the compositor is locked, all surfaces are moved from the
compositor's list to a private list in the shell plugin. This prevents
any of those surfaces from being visible or receiving input. All new
surfaces will be moved to the private list, too.
The background surface is an exception, it is left to the compositor's
list, so the background will be painted. It is assumed that the
background surface does not allow any actions while being locked.
When desktop-shell announces a lock surface (an unlock dialog), it is
added to the compositor's list, so the user can interact with it.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
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>
Add protocol and functions for supporting screen locking, triggered by
activity timeout.
After activity timeout, compositor starts the fade to black, and then
enters SLEEPING state. At that point it calls lock() in the shell
plugin.
When input events trigger a wakeup, unlock() in the shell plugin is
called. This sends prepare_lock_surface event to the desktop-shell
client. The screen stays locked while the compositor starts fade-in.
At this point, desktop-shell client usually creates a surface for the
unlocking GUI (e.g. a password prompt), and sends it with the
set_lock_surface request. The compositor supposedly shows and allows
interaction only with the given lock surface (not yet implemented).
When desktop-shell has authenticated the user, or instead of issuing
set_lock_surface, it sends the unlock request. Upon receiving the unlock
request, the shell plugin unlocks the screen.
If desktop-shell client dies, the screen is unlocked automatically.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This is the same as the damage of the top-level surface so just use that.
There's a problem that if we change the stacking, the damage layering breaks,
but that's a problem we already have.
The shell module only needs to deal with attach when it's either the initial
attach or when the attach changes the size of the surface. In case of
initial attach, the shell needs to pick a position for the surface and a
place in the surface stack. We split this case out as a new shell->map
callback. The other case is split into the shell->configure callback,
where the shell may adjust the surface position or reject the new size.
The drm compositor always creates a 64x64 bo for the cursor image
regardless of the size of the actual cursor. When the fade animation
kicks in it disables the hardware cursor so that it is rendered as a
regular surface. This surface is rendered to a 32x32 region but using
a 64x64 texture so the cursor gets scaled down.
Fix this by making create_cursor_image return the actual size of the
image created to the compositor.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
On repaint, wlsc_output_repaint will replace output->scanout_buffer with
the new front buffer and then output->present() will cause this buffer
to be displayed. When wlsc_output_finish_frame is called, the
compositor will send a release buffer event for output->scanout_buffer
which is actually the front buffer now.
This patch changes this code to release the previous scanout_buffer
instead of the front buffer on wlsc_output_finish_frame.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
The files in question are copyright Benjamin Franzke (who agrees),
Intel Corporation, Red Hat and myself. On behalf of Red Hat,
Richard Fontana says:
"Therefore, to the extent that Red Hat, Inc. has any copyright
interest in the files you cited as of this date (compositor-drm.c,
compositor.c, compositor.h, screenshooter.c in
http://cgit.freedesktop.org/wayland/wayland-demos/tree/compositor),
Red Hat hereby elects to apply the CC0 1.0 Universal Public Domain
Dedication to such copyrighted material. See:
http://creativecommons.org/publicdomain/zero/1.0/legalcode .
Thanks,
Richard E. Fontana
Open Source Licensing and Patent Counsel
Red Hat, Inc."
Adds a general wlsc_compositor_shutdown() function that all output
backends call when shutting down. wlsc_compositor_shutdown() will call
a new 'destroy' method of each output to perform backend-specific
cleanup (e.g., turning off the hardware cursor in the DRM compositor).
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
The shell module is responsible for implementing the higher level
compositor behavior. We default to the desktop-lite shell built in to
the compositor.