summaryrefslogtreecommitdiff
path: root/clutter
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-04-12 13:07:34 +1000
committerEmmanuele Bassi <ebassi@linux.intel.com>2012-04-12 11:38:46 +0100
commit600307da78dcc5c69e5cb754e12e5d9a36e1ba5c (patch)
tree58f2e12768d4a3f83aa2d8aaf90b9ddd9802053f /clutter
parent32e6eb08aef7421ae3ce00b53a0b9c9a548098fb (diff)
downloadclutter-600307da78dcc5c69e5cb754e12e5d9a36e1ba5c.tar.gz
Rename XINPUT_2_2 define to HAVE_XINPUT_2_2
configure.ac defines XINPUT_2_2 if XI 2.2 support was found. The code expects XINPUT_2_2 in the device manager, but HAVE_XINPUT_2_2 in the x11 backend. On newer X servers, the latter causes a BadValue when XIQueryDevice sends a different major/minor than gdk's device manager (gnome-control-center). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> https://bugzilla.gnome.org/show_bug.cgi?id=673961
Diffstat (limited to 'clutter')
-rw-r--r--clutter/x11/clutter-device-manager-xi2.c26
-rw-r--r--clutter/x11/clutter-input-device-xi2.c4
2 files changed, 15 insertions, 15 deletions
diff --git a/clutter/x11/clutter-device-manager-xi2.c b/clutter/x11/clutter-device-manager-xi2.c
index 327f3b041..144dc3fa1 100644
--- a/clutter/x11/clutter-device-manager-xi2.c
+++ b/clutter/x11/clutter-device-manager-xi2.c
@@ -154,7 +154,7 @@ translate_device_classes (Display *xdisplay,
(XIValuatorClassInfo *) class_info);
break;
-#ifdef XINPUT_2_2
+#ifdef HAVE_XINPUT_2_2
case XIScrollClass:
{
XIScrollClassInfo *scroll_info = (XIScrollClassInfo *) class_info;
@@ -178,7 +178,7 @@ translate_device_classes (Display *xdisplay,
scroll_info->increment);
}
break;
-#endif /* XINPUT_2_2 */
+#endif /* HAVE_XINPUT_2_2 */
default:
break;
@@ -192,7 +192,7 @@ is_touch_device (XIAnyClassInfo **classes,
ClutterInputDeviceType *device_type,
guint *n_touch_points)
{
-#ifdef XINPUT_2_2
+#ifdef HAVE_XINPUT_2_2
guint i;
for (i = 0; i < n_classes; i++)
@@ -483,11 +483,11 @@ get_event_stage (ClutterEventTranslator *translator,
case XI_ButtonPress:
case XI_ButtonRelease:
case XI_Motion:
-#ifdef XINPUT_2_2
+#ifdef HAVE_XINPUT_2_2
case XI_TouchBegin:
case XI_TouchUpdate:
case XI_TouchEnd:
-#endif /* XINPUT_2_2 */
+#endif /* HAVE_XINPUT_2_2 */
{
XIDeviceEvent *xev = (XIDeviceEvent *) xi_event;
@@ -855,10 +855,10 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
stage_x11,
&xev->valuators);
-#ifdef XINPUT_2_2
+#ifdef HAVE_XINPUT_2_2
if (xev->flags & XIPointerEmulated)
_clutter_event_set_pointer_emulated (event, TRUE);
-#endif /* XINPUT_2_2 */
+#endif /* HAVE_XINPUT_2_2 */
break;
default:
@@ -907,10 +907,10 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
event->button.y,
event->button.axes != NULL ? "yes" : "no");
-#ifdef XINPUT_2_2
+#ifdef HAVE_XINPUT_2_2
if (xev->flags & XIPointerEmulated)
_clutter_event_set_pointer_emulated (event, TRUE);
-#endif /* XINPUT_2_2 */
+#endif /* HAVE_XINPUT_2_2 */
if (xi_event->evtype == XI_ButtonPress)
_clutter_stage_x11_set_user_time (stage_x11, event->button.time);
@@ -987,10 +987,10 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
if (source_device != NULL && device->stage != NULL)
_clutter_input_device_set_stage (source_device, device->stage);
-#ifdef XINPUT_2_2
+#ifdef HAVE_XINPUT_2_2
if (xev->flags & XIPointerEmulated)
_clutter_event_set_pointer_emulated (event, TRUE);
-#endif /* XINPUT_2_2 */
+#endif /* HAVE_XINPUT_2_2 */
CLUTTER_NOTE (EVENT, "motion: win:0x%x device:%s (x:%.2f, y:%.2f, axes:%s)",
(unsigned int) stage_x11->xwin,
@@ -1003,7 +1003,7 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
}
break;
-#ifdef XINPUT_2_2
+#ifdef HAVE_XINPUT_2_2
case XI_TouchBegin:
case XI_TouchEnd:
{
@@ -1111,7 +1111,7 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
retval = CLUTTER_TRANSLATE_QUEUE;
}
break;
-#endif /* XINPUT_2_2 */
+#endif /* HAVE_XINPUT_2_2 */
case XI_Enter:
case XI_Leave:
diff --git a/clutter/x11/clutter-input-device-xi2.c b/clutter/x11/clutter-input-device-xi2.c
index fb9f272fb..c2b0d183d 100644
--- a/clutter/x11/clutter-input-device-xi2.c
+++ b/clutter/x11/clutter-input-device-xi2.c
@@ -92,7 +92,7 @@ clutter_input_device_xi2_select_stage_events (ClutterInputDevice *device,
if (event_mask & LeaveWindowMask)
XISetMask (mask, XI_Leave);
-#ifdef XINPUT_2_2
+#ifdef HAVE_XINPUT_2_2
/* enable touch event support if we're running on XInput 2.2 */
if (backend_x11->xi_minor >= 2)
{
@@ -100,7 +100,7 @@ clutter_input_device_xi2_select_stage_events (ClutterInputDevice *device,
XISetMask (mask, XI_TouchUpdate);
XISetMask (mask, XI_TouchEnd);
}
-#endif /* XINPUT_2_2 */
+#endif /* HAVE_XINPUT_2_2 */
xi_event_mask.deviceid = device_xi2->device_id;
xi_event_mask.mask = mask;