diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt index a2676fcce7..ef7b38c1ad 100644 --- a/docs/reference/gdk/gdk4-sections.txt +++ b/docs/reference/gdk/gdk4-sections.txt @@ -676,7 +676,6 @@ gdk_seat_capabilities_get_type GdkDeviceManager gdkdevicemanager 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 cd133b49cc..22430f60c4 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 7a561099d3..8183b757b0 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 d970a8d0e3..b97f6643e3 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 0ef2aaa444..6ea7132c6e 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 2e7ea1f41b..89036759cd 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 14918613b5..67ef483946 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 83d2a46aa5..1a35d2e034 100644 --- a/gtk/gtktestutils.c +++ b/gtk/gtktestutils.c @@ -40,6 +40,10 @@ #include #define GTK_COMPILATION +#ifdef GDK_WINDOWING_X11 +#include +#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 (); }