[gtk+] gdk: Move gdk_disable_multidevice tot he X11 backend



commit 4c40accbb989a427b8f6127b52e90ddd8d081129
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Nov 23 16:11:48 2017 -0500

    gdk: Move gdk_disable_multidevice tot he X11 backend
    
    This api only ever did something for X11, so move
    it there. Update the docs and adapt the only caller.

 docs/reference/gdk/gdk4-sections.txt |    2 +-
 gdk/gdkdevicemanager.c               |   20 --------------------
 gdk/gdkdevicemanager.h               |    3 ---
 gdk/gdkglobals.c                     |    1 -
 gdk/gdkinternals.h                   |    1 -
 gdk/x11/gdkdevicemanager-x11.c       |   22 ++++++++++++++++++++++
 gdk/x11/gdkx11devicemanager.h        |    3 +++
 gtk/gtktestutils.c                   |    6 ++++++
 8 files changed, 32 insertions(+), 26 deletions(-)
---
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt
index a2676fc..ef7b38c 100644
--- a/docs/reference/gdk/gdk4-sections.txt
+++ b/docs/reference/gdk/gdk4-sections.txt
@@ -676,7 +676,6 @@ gdk_seat_capabilities_get_type
 <TITLE>GdkDeviceManager</TITLE>
 <FILE>gdkdevicemanager</FILE>
 GdkDeviceManager
-gdk_disable_multidevice
 gdk_device_manager_get_display
 gdk_device_manager_list_devices
 
@@ -914,6 +913,7 @@ gdk_x11_lookup_xdisplay
 gdk_x11_get_server_time
 gdk_x11_device_get_id
 gdk_x11_device_manager_lookup
+gdk_disable_multidevice
 gdk_x11_display_open
 gdk_x11_display_set_program_class
 gdk_x11_display_get_user_time
diff --git a/gdk/gdkdevicemanager.c b/gdk/gdkdevicemanager.c
index cd133b4..22430f6 100644
--- a/gdk/gdkdevicemanager.c
+++ b/gdk/gdkdevicemanager.c
@@ -339,23 +339,3 @@ gdk_device_manager_list_devices (GdkDeviceManager *device_manager,
 
   return GDK_DEVICE_MANAGER_GET_CLASS (device_manager)->list_devices (device_manager, type);
 }
-
-/**
- * gdk_disable_multidevice:
- *
- * Disables multidevice support in GDK. This call must happen prior
- * to gdk_display_open(), gtk_init() or gtk_init_check() in order to
- * take effect.
- *
- * Most common GTK+ applications won’t ever need to call this. Only
- * applications that do mixed GDK/Xlib calls could want to disable
- * multidevice support if such Xlib code deals with input devices in
- * any way and doesn’t observe the presence of XInput 2.
- *
- * Since: 3.0
- */
-void
-gdk_disable_multidevice (void)
-{
-  _gdk_disable_multidevice = TRUE;
-}
diff --git a/gdk/gdkdevicemanager.h b/gdk/gdkdevicemanager.h
index 7a56109..8183b75 100644
--- a/gdk/gdkdevicemanager.h
+++ b/gdk/gdkdevicemanager.h
@@ -41,9 +41,6 @@ GDK_DEPRECATED_IN_3_20
 GList *      gdk_device_manager_list_devices       (GdkDeviceManager *device_manager,
                                                     GdkDeviceType     type);
 
-GDK_AVAILABLE_IN_ALL
-void         gdk_disable_multidevice               (void);
-
 
 G_END_DECLS
 
diff --git a/gdk/gdkglobals.c b/gdk/gdkglobals.c
index d970a8d..b97f664 100644
--- a/gdk/gdkglobals.c
+++ b/gdk/gdkglobals.c
@@ -31,7 +31,6 @@
 
 guint               _gdk_debug_flags = 0;
 GList              *_gdk_default_filters = NULL;
-gboolean            _gdk_disable_multidevice = FALSE;
 guint               _gdk_gl_flags = 0;
 guint               _gdk_vulkan_flags = 0;
 GdkRenderingMode    _gdk_rendering_mode = GDK_RENDERING_MODE_SIMILAR;
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index 0ef2aaa..6ea7132 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -294,7 +294,6 @@ struct _GdkWindow
 #define GDK_WINDOW_DESTROYED(d) (((GdkWindow *)(d))->destroyed)
 
 extern gint       _gdk_screen_number;
-extern gboolean   _gdk_disable_multidevice;
 
 GdkEvent* _gdk_event_unqueue (GdkDisplay *display);
 
diff --git a/gdk/x11/gdkdevicemanager-x11.c b/gdk/x11/gdkdevicemanager-x11.c
index 2e7ea1f..8903675 100644
--- a/gdk/x11/gdkdevicemanager-x11.c
+++ b/gdk/x11/gdkdevicemanager-x11.c
@@ -31,6 +31,8 @@
 #define VIRTUAL_CORE_POINTER_ID 2
 #define VIRTUAL_CORE_KEYBOARD_ID 3
 
+static gboolean _gdk_disable_multidevice = FALSE;
+
 GdkDeviceManager *
 _gdk_x11_device_manager_new (GdkDisplay *display)
 {
@@ -156,3 +158,23 @@ gdk_x11_device_get_id (GdkDevice *device)
 
   return device_id;
 }
+
+/**
+ * gdk_disable_multidevice:
+ *
+ * Disables multidevice support in GDKs X11 backend. This call must happen prior
+ * to gdk_display_open(), gtk_init() or gtk_init_check() in order to
+ * take effect.
+ *
+ * Most common GTK+ applications won’t ever need to call this. Only
+ * applications that do mixed GDK/Xlib calls could want to disable
+ * multidevice support if such Xlib code deals with input devices in
+ * any way and doesn’t observe the presence of XInput 2.
+ *
+ * Since: 3.0
+ */
+void
+gdk_disable_multidevice (void)
+{
+  _gdk_disable_multidevice = TRUE;
+}
diff --git a/gdk/x11/gdkx11devicemanager.h b/gdk/x11/gdkx11devicemanager.h
index 1491861..67ef483 100644
--- a/gdk/x11/gdkx11devicemanager.h
+++ b/gdk/x11/gdkx11devicemanager.h
@@ -32,6 +32,9 @@ G_BEGIN_DECLS
 GDK_AVAILABLE_IN_3_2
 GdkDevice * gdk_x11_device_manager_lookup (GdkDeviceManager *device_manager,
                                            gint              device_id);
+GDK_AVAILABLE_IN_ALL
+void         gdk_disable_multidevice (void);
+
 
 G_END_DECLS
 
diff --git a/gtk/gtktestutils.c b/gtk/gtktestutils.c
index 83d2a46..1a35d2e 100644
--- a/gtk/gtktestutils.c
+++ b/gtk/gtktestutils.c
@@ -40,6 +40,10 @@
 #include <gtk/gtk.h>
 #define GTK_COMPILATION
 
+#ifdef GDK_WINDOWING_X11
+#include <gdk/x11/gdkx.h>
+#endif
+
 /**
  * SECTION:gtktesting
  * @Short_description: Utilities for testing GTK+ applications
@@ -94,7 +98,9 @@ gtk_test_init (int    *argcp,
    * send events that GTK+ understands if XI2 is
    * disabled, bummer.
    */
+#ifdef GDK_WINDOWING_X11
   gdk_disable_multidevice ();
+#endif
 
   gtk_init ();
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]