This is similar to clutter_x11_{,un}trap_errors except that it stores
the previous trap state in a caller-allocated struct so that it can be
re-entrant.
Make _cogl_xlib_trap_errors re-entrant
(this will be squashed into an earlier commit)
The Clutter X11 backend now passes all events through
_cogl_xlib_handle_event. This function can now internally be hooked
with _cogl_xlib_add_filter. These are added to a list of callbacks
which are all called in turn by _cogl_xlib_handle_event. This is
intended to be used internally in Cogl by any parts that need to see
Xlib events.
Cogl now also has an internally exposed function to set a pointer to
the Xlib display. This is stored in a global variable. The Clutter X11
backend sets this.
_cogl_xlib_handle_event and _cogl_xlib_set_display can be removed once
Cogl gains a proper window system abstraction.