[maemo-commits] [maemo-commits] r18779 - in projects/haf/trunk/gtk+: . gdk/x11

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Jun 23 13:19:20 EEST 2009
Author: mitch
Date: 2009-06-23 13:18:38 +0300 (Tue, 23 Jun 2009)
New Revision: 18779

Modified:
   projects/haf/trunk/gtk+/ChangeLog
   projects/haf/trunk/gtk+/configure.in
   projects/haf/trunk/gtk+/gdk/x11/gdkinput-x11.c
   projects/haf/trunk/gtk+/gdk/x11/gdkinput-xfree.c
Log:
2009-06-23  Michael Natterer  <mitch at lanedo.com>

	Revert Xinput-related commits, they can't work with the
	version of X we use:

	2009-06-17  Christian Dywan  <christian at lanedo.com>

	* gdk/x11/gdkinput-x11.c (gdk_input_device_new): Move back to core
	events and do not enable the touchscreen slave device by default.
	Patch by Carlos Garnacho.
	Fixes: NB#122714 Unable to select a particular word or character

	2009-06-05  Carlos Garnacho  <carlos at lanedo.com>

	Fixes: NB#95806 - Pressure data not received from motion events.
 
	* configure.in: Detect XInput >= 1.1.99.
	* gdk/x11/gdkinput-xfree.c (gdk_input_init):
	* gdk/x11/gdkinput-x11.c (_gdk_input_common_init)
	(gdk_input_translate_coordinates) (gdk_input_device_new)
	(_gdk_input_common_other_event): Use XInput 2 features if available,
	initialize correctly all devices in this case, and also translate
	axis/coordinates from the extended events.



Modified: projects/haf/trunk/gtk+/ChangeLog
===================================================================
--- projects/haf/trunk/gtk+/ChangeLog	2009-06-23 10:09:02 UTC (rev 18778)
+++ projects/haf/trunk/gtk+/ChangeLog	2009-06-23 10:18:38 UTC (rev 18779)
@@ -1,5 +1,29 @@
 2009-06-23  Michael Natterer  <mitch at lanedo.com>
 
+	Revert Xinput-related commits, they can't work with the
+	version of X we use:
+
+	2009-06-17  Christian Dywan  <christian at lanedo.com>
+
+	* gdk/x11/gdkinput-x11.c (gdk_input_device_new): Move back to core
+	events and do not enable the touchscreen slave device by default.
+	Patch by Carlos Garnacho.
+	Fixes: NB#122714 Unable to select a particular word or character
+
+	2009-06-05  Carlos Garnacho  <carlos at lanedo.com>
+
+	Fixes: NB#95806 - Pressure data not received from motion events.
+ 
+	* configure.in: Detect XInput >= 1.1.99.
+	* gdk/x11/gdkinput-xfree.c (gdk_input_init):
+	* gdk/x11/gdkinput-x11.c (_gdk_input_common_init)
+	(gdk_input_translate_coordinates) (gdk_input_device_new)
+	(_gdk_input_common_other_event): Use XInput 2 features if available,
+	initialize correctly all devices in this case, and also translate
+	axis/coordinates from the extended events.
+
+2009-06-23  Michael Natterer  <mitch at lanedo.com>
+
 	* === Maemo-GTK+ 2.14.7 ===
 
 	Upstream ChangeLog entries from 2.14.3 to 2.14.7 have been

Modified: projects/haf/trunk/gtk+/configure.in
===================================================================
--- projects/haf/trunk/gtk+/configure.in	2009-06-23 10:09:02 UTC (rev 18778)
+++ projects/haf/trunk/gtk+/configure.in	2009-06-23 10:18:38 UTC (rev 18779)
@@ -1531,10 +1531,6 @@
     
     if $PKG_CONFIG --exists xi ; then
       X_PACKAGES="$X_PACKAGES xi"
-
-      if $PKG_CONFIG --exists "xi >= 1.1.99" ; then
-        AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available])
-      fi
     else
       GTK_ADD_LIB(x_extra_libs, Xi)
     fi

Modified: projects/haf/trunk/gtk+/gdk/x11/gdkinput-x11.c
===================================================================
--- projects/haf/trunk/gtk+/gdk/x11/gdkinput-x11.c	2009-06-23 10:09:02 UTC (rev 18778)
+++ projects/haf/trunk/gtk+/gdk/x11/gdkinput-x11.c	2009-06-23 10:18:38 UTC (rev 18779)
@@ -122,11 +122,7 @@
 
   tmp_name = g_ascii_strdown (gdkdev->info.name, -1);
   
-#ifdef MAEMO_CHANGES
-  if (g_str_has_suffix (tmp_name, "pointer"))
-#else
   if (!strcmp (tmp_name, "pointer"))
-#endif
     gdkdev->info.source = GDK_SOURCE_MOUSE;
   else if (!strcmp (tmp_name, "wacom") ||
 	   !strcmp (tmp_name, "pen"))
@@ -226,10 +222,8 @@
       (!include_core && device->use == IsXPointer))
     goto error;
 
-#if !defined (MAEMO_CHANGES) || !defined (XINPUT_2)
   if (device->use != IsXPointer)
     {
-#endif
       gdk_error_trap_push ();
       gdkdev->xdevice = XOpenDevice (GDK_DISPLAY_XDISPLAY (display),
 				     gdkdev->deviceid);
@@ -237,9 +231,7 @@
       /* return NULL if device is not ready */
       if (gdk_error_trap_pop ())
 	goto error;
-#if !defined (MAEMO_CHANGES) || !defined (XINPUT_2)
     }
-#endif
 
   gdkdev->buttonpress_type = 0;
   gdkdev->buttonrelease_type = 0;
@@ -250,6 +242,15 @@
   gdkdev->proximityout_type = 0;
   gdkdev->changenotify_type = 0;
 
+#ifdef MAEMO_CHANGES
+  /* always enable extension events to get touchscreen pressure */
+  if (gdkdev->info.source == GDK_SOURCE_PEN)
+    {
+      if (!gdk_device_set_mode (&gdkdev->info, GDK_MODE_SCREEN))
+        g_warning ("Failed to enable pressure on `%s'", gdkdev->info.name);
+    }
+#endif /* MAEMO_CHANGES */
+
   return gdkdev;
 
  error:
@@ -399,10 +400,6 @@
   if (XQueryExtension (display_x11->xdisplay, "XInputExtension",
 		       &ignore, &event_base, &ignore))
     {
-#if defined (MAEMO_CHANGES) && defined (XINPUT_2)
-      XQueryInputVersion(display_x11->xdisplay, XI_2_Major, XI_2_Minor);
-#endif
-
       gdk_x11_register_standard_event_type (display,
 					    event_base, 15 /* Number of events */);
 
@@ -597,24 +594,11 @@
       event->button.time = xdbe->time;
 
       event->button.axes = g_new (gdouble, gdkdev->info.num_axes);
-
-#if !defined (MAEMO_CHANGES) || !defined (XINPUT_2)
-      gdk_input_translate_coordinates (gdkdev, input_window, xdbe->axis_data,
-                                       event->button.axes,
-                                       &event->button.x, &event->button.y);
+      gdk_input_translate_coordinates (gdkdev,input_window, xdbe->axis_data,
+				       event->button.axes, 
+				       &event->button.x,&event->button.y);
       event->button.x_root = event->button.x + input_window->root_x;
       event->button.y_root = event->button.y + input_window->root_y;
-#else
-      gdk_input_translate_coordinates (gdkdev, input_window, xdbe->axis_data,
-                                       event->button.axes,
-                                       NULL, NULL);
-
-      event->button.x = (gdouble) xdbe->x;
-      event->button.y = (gdouble) xdbe->y;
-      event->button.x_root = (gdouble) xdbe->x_root;
-      event->button.y_root = (gdouble) xdbe->y_root;
-#endif
-
       event->button.state = gdk_input_translate_state(xdbe->state,xdbe->device_state);
       event->button.button = xdbe->button;
 
@@ -712,24 +696,12 @@
       event->motion.device = &gdkdev->info;
       
       event->motion.axes = g_new (gdouble, gdkdev->info.num_axes);
-
-#if !defined (MAEMO_CHANGES) || !defined (XINPUT_2)
-      gdk_input_translate_coordinates (gdkdev, input_window, xdme->axis_data,
-                                       event->motion.axes,
-                                       &event->motion.x, &event->motion.y);
+      gdk_input_translate_coordinates(gdkdev,input_window,xdme->axis_data,
+				      event->motion.axes,
+				      &event->motion.x,&event->motion.y);
       event->motion.x_root = event->motion.x + input_window->root_x;
       event->motion.y_root = event->motion.y + input_window->root_y;
-#else
-      gdk_input_translate_coordinates (gdkdev, input_window, xdme->axis_data,
-                                       event->motion.axes,
-                                       NULL, NULL);
 
-      event->motion.x = (gdouble) xdme->x;
-      event->motion.y = (gdouble) xdme->y;
-      event->motion.x_root = (gdouble) xdme->x_root;
-      event->motion.y_root = (gdouble) xdme->y_root;
-#endif
-
       event->motion.type = GDK_MOTION_NOTIFY;
       event->motion.window = input_window->window;
       event->motion.time = xdme->time;

Modified: projects/haf/trunk/gtk+/gdk/x11/gdkinput-xfree.c
===================================================================
--- projects/haf/trunk/gtk+/gdk/x11/gdkinput-xfree.c	2009-06-23 10:09:02 UTC (rev 18778)
+++ projects/haf/trunk/gtk+/gdk/x11/gdkinput-xfree.c	2009-06-23 10:18:38 UTC (rev 18779)
@@ -38,11 +38,7 @@
 {
   _gdk_init_input_core (display);
   GDK_DISPLAY_X11 (display)->input_ignore_core = FALSE;
-#ifdef MAEMO_CHANGES
-  _gdk_input_common_init (display, TRUE);
-#else
   _gdk_input_common_init (display, FALSE);
-#endif
 }
 
 gboolean

More information about the maemo-commits mailing list