]> Pileus Git - ~andy/gtk/blobdiff - gdk/x11/gdkdevicemanager-x11.c
Require XInput2.h in X11 backend
[~andy/gtk] / gdk / x11 / gdkdevicemanager-x11.c
index b49230454dfcd00bc4a1bd9a773142dff2acae0f..a34ff664cae44dc7be511d3e42835775b1c50a4e 100644 (file)
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
 
 #include "gdkx11devicemanager-core.h"
 #include "gdkdevicemanagerprivate-core.h"
-#ifdef XINPUT_XFREE
-#include "gdkx11devicemanager-xi.h"
 #ifdef XINPUT_2
 #include "gdkx11devicemanager-xi2.h"
 #endif
-#endif
 #include "gdkinternals.h"
 #include "gdkprivate-x11.h"
 
@@ -41,7 +36,7 @@ _gdk_x11_device_manager_new (GdkDisplay *display)
 {
   if (!g_getenv ("GDK_CORE_DEVICE_EVENTS"))
     {
-#if defined (XINPUT_2) || defined (XINPUT_XFREE)
+#ifdef XINPUT_2
       int opcode, firstevent, firsterror;
       Display *xdisplay;
 
@@ -50,11 +45,14 @@ _gdk_x11_device_manager_new (GdkDisplay *display)
       if (XQueryExtension (xdisplay, "XInputExtension",
                            &opcode, &firstevent, &firsterror))
         {
-#ifdef XINPUT_2
           int major, minor;
 
           major = 2;
+#ifdef XINPUT_2_2
+         minor = 2;
+#else
           minor = 0;
+#endif /* XINPUT_2_2 */
 
           if (!_gdk_disable_multidevice &&
               XIQueryVersion (xdisplay, &major, &minor) != BadRequest)
@@ -66,22 +64,14 @@ _gdk_x11_device_manager_new (GdkDisplay *display)
               device_manager_xi2 = g_object_new (GDK_TYPE_X11_DEVICE_MANAGER_XI2,
                                                  "display", display,
                                                  "opcode", opcode,
+                                                 "major", major,
+                                                 "minor", minor,
                                                  NULL);
 
               return GDK_DEVICE_MANAGER (device_manager_xi2);
             }
-          else
-#endif /* XINPUT_2 */
-            {
-              GDK_NOTE (INPUT, g_print ("Creating XI device manager\n"));
-
-              return g_object_new (GDK_TYPE_X11_DEVICE_MANAGER_XI,
-                                   "display", display,
-                                   "event-base", firstevent,
-                                   NULL);
-            }
         }
-#endif /* XINPUT_2 || XINPUT_XFREE */
+#endif /* XINPUT_2 */
     }
 
   GDK_NOTE (INPUT, g_print ("Creating core device manager\n"));
@@ -100,6 +90,8 @@ _gdk_x11_device_manager_new (GdkDisplay *display)
  *
  * Returns: (transfer none): (allow-none): The #GdkDevice wrapping the device ID,
  *          or %NULL if the given ID doesn't currently represent a device.
+ *
+ * Since: 3.2
  **/
 GdkDevice *
 gdk_x11_device_manager_lookup (GdkDeviceManager *device_manager,
@@ -145,6 +137,8 @@ gdk_x11_device_manager_lookup (GdkDeviceManager *device_manager,
  * </note>
  *
  * Returns: the XInput2 device ID.
+ *
+ * Since: 3.2
  **/
 gint
 gdk_x11_device_get_id (GdkDevice *device)