AC_MSG_WARN([You are building Emacs with GTK+ 2 and the X Input Extension version 2.
This might lead to problems if your version of GTK+ is not built with support for XInput 2.])
fi
- # Detect both faulty installations of libXi where gesture event
- # types are defined but gesture event structures are not, and
- # also where gesture event structures are empty.
- AC_CHECK_MEMBERS([XIGesturePinchEvent.delta_unaccel_y],
- [AC_DEFINE(HAVE_USABLE_XI_GESTURE_PINCH_EVENT, 1,
- [Define to 1 if XInput headers define gesture structures correctly.])],
- [], [[#include <X11/extensions/XInput2.h>]])
+
+ # Now check for some members (which used in conjunction with
+ # protocol definitions) can be used to determine the version of
+ # XInput supported.
+ AC_CHECK_MEMBERS([XIScrollClassInfo.type, XITouchClassInfo.type,
+ XIBarrierReleasePointerInfo.deviceid, XIGestureClassInfo.type],
+ [], [], [#include <X11/extensions/XInput2.h>])
fi
fi
AC_SUBST(XINPUT_CFLAGS)
XISetMask (m, XI_PropertyEvent);
XISetMask (m, XI_HierarchyChanged);
XISetMask (m, XI_DeviceChanged);
-#ifdef XI_TouchBegin
+#ifdef HAVE_XINPUT2_2
if (FRAME_DISPLAY_INFO (f)->xi2_version >= 2)
{
XISetMask (m, XI_TouchBegin);
XISetMask (m, XI_TouchUpdate);
XISetMask (m, XI_TouchEnd);
-#ifdef XI_GesturePinchBegin
+#ifdef HAVE_XINPUT2_4
if (FRAME_DISPLAY_INFO (f)->xi2_version >= 4)
{
XISetMask (m, XI_GesturePinchBegin);
{
switch (device->classes[c]->type)
{
-#ifdef XIScrollClass /* XInput 2.1 */
+#ifdef HAVE_XINPUT2_1
case XIScrollClass:
{
XIScrollClassInfo *info =
break;
}
#endif
-#ifdef XITouchClass /* XInput 2.2 */
+#ifdef HAVE_XINPUT2_2
case XITouchClass:
{
XITouchClassInfo *info;
return NULL;
}
-#ifdef XI_TouchBegin
+#ifdef HAVE_XINPUT2_2
static void
xi_link_touch_point (struct xi_device_t *device,
if (!device)
goto XI_OTHER;
-#ifdef XI_TouchBegin
+#ifdef HAVE_XINPUT2_2
if (xev->flags & XIPointerEmulated)
goto XI_OTHER;
#endif
{
struct xi_device_t *device;
struct xi_touch_point_t *tem, *last;
- int c, i;
+ int c;
+#ifdef HAVE_XINPUT2_1
+ int i;
+#endif
device = xi_device_from_id (dpyinfo, device_changed->deviceid);
{
switch (device_changed->classes[c]->type)
{
-#ifdef XIScrollClass
+#ifdef HAVE_XINPUT2_1
case XIScrollClass:
{
XIScrollClassInfo *info;
}
#endif
-#ifdef XITouchClass
+#ifdef HAVE_XINPUT2_2
case XITouchClass:
{
XITouchClassInfo *info;
}
}
-#ifdef XIScrollClass
+#ifdef HAVE_XINPUT2_1
for (c = 0; c < device_changed->num_classes; ++c)
{
if (device_changed->classes[c]->type == XIValuatorClass)
goto XI_OTHER;
}
-#ifdef XI_TouchBegin
+#ifdef HAVE_XINPUT2_2
case XI_TouchBegin:
{
struct xi_device_t *device;
}
#endif
-#ifdef XI_GesturePinchBegin
+
+#ifdef HAVE_XINPUT2_4
case XI_GesturePinchBegin:
case XI_GesturePinchUpdate:
{
x_display_set_last_user_time (dpyinfo, xi_event->time);
-#ifdef HAVE_USABLE_XI_GESTURE_PINCH_EVENT
XIGesturePinchEvent *pev = (XIGesturePinchEvent *) xi_event;
struct xi_device_t *device = xi_device_from_id (dpyinfo, pev->deviceid);
make_float (pev->scale),
make_float (pev->delta_angle));
}
-#endif
+
/* Once again GTK seems to crash when confronted by
events it doesn't understand. */
*finish = X_EVENT_DROP;
dpyinfo->supports_xi2 = false;
int rc;
int major = 2;
-#ifdef XI_GesturePinchBegin /* XInput 2.4 */
+#ifdef HAVE_XINPUT2_4
int minor = 4;
-#elif XI_BarrierHit /* XInput 2.3 */
+#elif defined HAVE_XINPUT2_3 /* XInput 2.3 */
int minor = 3;
-#elif defined XI_TouchBegin /* XInput 2.2 */
+#elif defined HAVE_XINPUT2_2 /* XInput 2.2 */
int minor = 2;
-#elif defined XIScrollClass /* XInput 2.1 */
+#elif defined HAVE_XINPUT2_1 /* XInput 2.1 */
int minor = 1;
#else /* Some old version of XI2 we're not interested in. */
int minor = 0;
#include <X11/Xmu/Editres.h>
#endif
+#ifdef HAVE_XINPUT2
+#include <X11/extensions/XInput2.h>
+#endif
+
typedef Widget xt_or_gtk_widget;
#endif
(nr).width = (rwidth), \
(nr).height = (rheight))
+#ifdef HAVE_XINPUT2
+#if HAVE_XISCROLLCLASSINFO_TYPE && defined XIScrollClass
+#define HAVE_XINPUT2_1
+#endif
+#if HAVE_XITOUCHCLASSINFO_TYPE && defined XITouchClass
+#define HAVE_XINPUT2_2
+#endif
+#if HAVE_XIBARRIERRELEASEPOINTERINFO_DEVICEID && defined XIBarrierPointerReleased
+#define HAVE_XINPUT2_3
+#endif
+#if HAVE_XIGESTURECLASSINFO_TYPE && defined XIGestureClass
+#define HAVE_XINPUT2_4
+#endif
+#endif
+
INLINE_HEADER_END
#endif /* XTERM_H */
XISetMask (m, XI_ButtonRelease);
XISetMask (m, XI_Enter);
XISetMask (m, XI_Leave);
-#ifdef XI_GesturePinchBegin
+#ifdef HAVE_XINPUT2_4
if (FRAME_DISPLAY_INFO (s->f)->xi2_version >= 4)
{
XISetMask (m, XI_GesturePinchBegin);