Leftovers from an intermediate patch set, the proper function name is
shell_get_shell_surface. Cosmetic change.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Since it is the desktop-shell plugin in the compositor that offers both
wl_shell global interface and wl_shell_surface interface, those are not
available on the tablet-shell plugin.
The tablet-shell client uses the toytoolkit, so toytoolkit must work
somehow even without wl_shell.
Turn all operations in toytoolkit that would require wl_shell or
wl_shell_surface into no-ops.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
get_shell_surface() returns NULL, if the client has not created or has
destroyed the wl_shell_surface object.
All but one use of get_shell_surface() just retrieve the surface type,
so just fall back to SHELL_SURFACE_NORMAL there.
Resize hot-key binding really needs the wl_shell_surface object, as that
is the only way to send configure events. For surfaces without a
wl_shell_surface, simply do not resize them.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Remove shell_priv member from wlsc_surface, and replace it by a search
through the wl_surface destroy_listener_list.
This technique avoids any "extension" members in the wlsc_surface
structure.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Change desktop-shell protocol to use wl_shell_surface instead of
wl_surface.
Adapt the desktop-shell client and the shell plugin.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Protocol changes in Wayland core introduced a new interface
wl_shell_surface, and moved all wl_shell surface methods into it. Adapt
the compositor and its Wayland backend, shell plugin, and all clients to
the new interface.
Depends on the Wayland core commit "protocol: introduce wl_shell_surface"
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
When a window destroyed, if any input had the window in keyboard
focus, the keyboard focus is reset to NULL. A new keyboard focus is set
only, if the user clicks something. If the user presses a key instead of
clicking, the key press event is sent to the client which has NULL
keyboard focus, triggering a segfault in window_handle_key().
Fix the segfault by ignoring the key event, if there is no target
window.
I triggered this segfault by clicking the unlock dialog away, and then
pressing a key.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Fix two bugs:
- if there are no backgrounds at all, the background pointer would have
been bogus. Lead to a segfault.
- if the hidden_surface_list is empty, wl_list_insert_list() would
corrupt the list. Lead to a hang in pick_surface().
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Enumerate the different surface purposes for the shell: background, panel,
lock surface, and normal (other) surfaces.
Instead of testing wlsc_surface pointers against known pointers, check
the purpose field.
This change will ease implementing per-output background, panel, etc.
when the number of "known" surface pointers grows dynamically.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Add a pointer to wlsc_surface for shell-private data. This is a
temporary solution.
Add struct shell_surface, where you can add any shell-private data
members related to a wlsc_surface. The getter function takes care of
creating the private data if it does not exist yet.
Not used anywhere yet.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
We'll want to enhance later the driver regarding the tool being used, but for
now just remove unused bits.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Since I have commented out all the config structures in glmatrix.c, it
was not getting proper default values. Hardcode some default there.
Remove glClear from reshape_matrix(), as wscreensaver does not support
rendering commands in reshape call.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Copy hacks/glx/glmatrix.c and hacks/images/matrix3.xpm from
xscreensaver-5.15 distribution package.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Very likely that 2.4 kernels won't be used with Wayland compositor so the
check for signal value is pretty much useless.
It's okay to change e->value inside evdev_process_absolute_motion_touchpad
given it's not used later on, and I also rather not touch this snip because it
will be changed when multi-touch support arrives.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
A copy & paste bug, that resulted setting to NULL something else than
shell->lock_surface when that surface was destroyed.
The symptom: let compositor lock down, unlock it, let it lock down
again, and the unlock dialog is never requested again. This bug was
triggered by the previous fix "shell: fix compositor wakeup while
locked".
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Compositor is locked, woken up, unlock dialog is shown; if the
compositor does to sleep again, before being unlocked, it will never
wake up again, because unlock() becomes a no-op, yet it should wake the
compositor up.
Fix this by letting unlock() to wake up the compositor, if lock surface
is present.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
When the lock surface was map()'d while the compositor was locked,
wlsc_surface_configure() was never called for the lock surface. Hence,
the surface->output was NULL, and the 'frame' event was never sent,
causing desktop-shell to loop in dri2_swap_buffers().
Fix this by calling wlsc_surface_configure() for the lock surface
always in map().
Additionally, adjust the comments in map() to make it more readable.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>