Commit e89d6b87 authored by Carlos Garnacho's avatar Carlos Garnacho

configure: Check for XGetEventData()

This is a call only available in recent libX11, only the XI2 code
depends on this within GDK, but XI2 implies having GenericEvents
available too.
parent 3285605c
......@@ -1096,6 +1096,10 @@ if test "x$enable_x11_backend" = xyes; then
fi
fi
# Check for XGetEventData for GenericEvents
AC_CHECK_FUNC(XGetEventData,
AC_DEFINE(HAVE_XGENERICEVENTS, 1, [Have XGenericEvent]))
# set up things for XInput
if test "x$enable_xinput" != "xno" && $PKG_CONFIG --exists "xi" ; then
have_xinput=yes
......
......@@ -177,11 +177,13 @@ gdk_event_source_translate_event (GdkEventSource *event_source,
dpy = GDK_DISPLAY_XDISPLAY (event_source->display);
#ifdef HAVE_XGENERICEVENTS
/* Get cookie data here so it's available
* to every event translator and event filter.
*/
if (xevent->type == GenericEvent)
XGetEventData (dpy, &xevent->xcookie);
#endif
filter_window = gdk_event_source_get_filter_window (event_source, xevent,
&event_translator);
......@@ -204,8 +206,10 @@ gdk_event_source_translate_event (GdkEventSource *event_source,
if (result != GDK_FILTER_CONTINUE)
{
#ifdef HAVE_XGENERICEVENTS
if (xevent->type == GenericEvent)
XFreeEventData (dpy, &xevent->xcookie);
#endif
if (result == GDK_FILTER_REMOVE)
{
......@@ -250,8 +254,10 @@ gdk_event_source_translate_event (GdkEventSource *event_source,
handle_focus_change (&event->crossing);
}
#ifdef HAVE_XGENERICEVENTS
if (xevent->type == GenericEvent)
XFreeEventData (dpy, &xevent->xcookie);
#endif
return event;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment