wlr_scene_*_create() functions all allocate memory via calloc() and
return NULL if the allocation fails. Previously, the failures were
handled in any of 3 different ways:
- sending a wayland protocol error
- exiting labwc with an error
- segfault (no NULL check at all)
Since labwc does not attempt to survive heap exhaustion in other
allocation paths (such as `znew`), it seems more consistent to use the
same die_if_null() check used in those paths to exit with an error.
For the three most common create() functions (tree, rect, buffer),
add small lab_wlr_ wrappers to common/scene-helpers.
This is a common practice in C projects, which simply enforces that
each header must compile cleanly without implicit dependencies on
other headers (see also the previous commit).
Need to handle new unified mapping, where mapping is attached to the
wlr_surface objects instead of their parents. Also, most of them require
a new associate event for xsurface objects, their surface member will be
NULL before this event is received.
Refactored by jlindgren:
- add struct mappable
- unify map/unmap logic
By default, leave keyboard-focus with the surface that originally had it
at the end of a dnd operation. This is consistent with the default
behaviour of openbox and mutter.
If the 'focus/followMouse' option is enabled, then focus on the surface
under the cursor at the end of the dnd operation.
Fixes: issue #976
Keyboard focus is not changed during drag, so we need to refocus the
surface under the cursor and the end of a drag-and-drop operation.
Fixes issue #939