mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-24 12:41:16 +00:00
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.
This commit is contained in:
parent
3285605c54
commit
e89d6b8741
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user