Previously for wayland clients to flush buffered connection data to the
compositor they needed to first register an event-mask-update-callback
via wl_display_get_fd() to determine if there is anything writeable
pending. (NB: It's considered an error to iterate connection data with
an invalid mask)
Since it's only possible to register a single update callback currently
it's a bit awkward if you want to allow multiple orthogonal components
to flush the connection data, such as Cogl and Clutter which both want
to interact with wayland and may want to flush commands at different
times.
This adds a mechanism, wl_display_flush(), which makes it possible to
flush writeable connection data without first checking the event mask.
When cross-compiling Wayland, wayland-scanner should be picked up from
the host system instead of compiling and trying to run e.g. ARM
wayland-scanner on X86.
This patch adds --disable-scanner option for disabling the scanner
from the build and using existing wayland-scanner instead (from PATH)
which should help in most cross-compilation systems.
By default everything works as before.
Signed-off-by: Jani Uusi-Rantala <jani.uusi-rantala@nokia.com>
We pass the poll mask so the dispatch callback can know if there is
data on the fd or not. The dispatch function must return true if
it dispatched something, in which case we need to do another round of
post-dispatch callbacks."
This lets a source mark itself as ready to dispatch even though the fd
didn't trigger. What can happen is that for the X11 socket, some other
source callback (the drm fd or a wayland client socket) can cause somebody
to do an X roundtrip (DRI2 get buffers, for example) and queue up events
in the xcb buffer. When we get back to epoll, the X fd no longer polls
readable and we don't process those events until we get another X event.
The check callback is called after a round of dispatching and lets a source
check if it has data to dispatch and mark itself ready. Next round of
dispatching will then process it immediately instead of blocking in
epoll_wait().
We remove the listener when a device loses its pointer focus, but
doesn't insert it in another destroy_listener list if surface is NULL.
When we set another pointer focus surface, we remove it again.
Tracked down and tested by Iskren Chernev.
For now, we just use glScissor and clip to the extent of the damage region,
but we can do even better by clipping the repaint to the region rectangles.