Calling wl_event_source_remove() will free the event source later, so
reset the pointer to avoid calling it two times on the same pointer.
Fix a compositor crash when copying some text from weston terminal,
pasting it in the same terminal and hitting ctrl-u, while a X client
is running.
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Typically we can write it immediately without blocking, so save the overhead
of setting up an fd watch and writing the data in a callback. For the
case where the immediate write doesn't write all data, we fallback and
set up the fd watch as usual.
This patch also consolidates setting up the async write a bit.
Because of its links to selection.c and xwayland, a destroy_signal field
was also added to wl_data_source. Before selection.c and xwayland were
manually initializing the resource.destroy_signal field so that it could be
used without a valid resource.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar
macros to expose the largest extent of functionality supported by the
underlying system. This is required since these macros are often
limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually
on some systems hide declarations which are not part of the X/Open spec.
Since this goes into config.h rather than the command line, ensure all
source is consistently including config.h before anything else,
including system libraries. This doesn't need to be guarded by a
HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org
modular transition.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
[pq: rebased and converted more files]