[gtk+/wip/matthiasc/kill-device-manager: 13/17] x11: Stop using gdk_display_get_device_manager



commit 94f0dbcc26df710cbf20358ce354f31ee08f0077
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Nov 24 09:14:17 2017 -0500

    x11: Stop using gdk_display_get_device_manager
    
    We can keep the displaymanager in the backend.

 gdk/x11/gdkdevice-xi2.c  |    8 ++------
 gdk/x11/gdkdisplay-x11.c |    8 ++------
 gdk/x11/gdkdisplay-x11.h |    1 +
 3 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index ab266b6..169ea16 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -433,9 +433,7 @@ gdk_x11_device_xi2_grab (GdkDevice    *device,
   gint status;
 
   display = gdk_device_get_display (device);
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-  device_manager_xi2 = GDK_X11_DEVICE_MANAGER_XI2 (gdk_display_get_device_manager (display));
-  G_GNUC_END_IGNORE_DEPRECATIONS;
+  device_manager_xi2 = GDK_X11_DEVICE_MANAGER_XI2 (GDK_X11_DISPLAY (display)->device_manager);
 
   /* FIXME: confine_to is actually unused */
 
@@ -683,9 +681,7 @@ gdk_x11_device_xi2_select_window_events (GdkDevice    *device,
   XIEventMask evmask;
 
   display = gdk_device_get_display (device);
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-  device_manager_xi2 = GDK_X11_DEVICE_MANAGER_XI2 (gdk_display_get_device_manager (display));
-  G_GNUC_END_IGNORE_DEPRECATIONS;
+  device_manager_xi2 = GDK_X11_DEVICE_MANAGER_XI2 (GDK_X11_DISPLAY (display)->device_manager);
 
   evmask.deviceid = device_xi2->device_id;
   evmask.mask = _gdk_x11_device_xi2_translate_event_mask (device_manager_xi2,
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 245df4a..351dffa 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1440,7 +1440,6 @@ static void
 gdk_event_init (GdkDisplay *display)
 {
   GdkX11Display *display_x11;
-  GdkDeviceManager *device_manager;
 
   display_x11 = GDK_X11_DISPLAY (display);
   display_x11->event_source = gdk_x11_event_source_new (display);
@@ -1448,11 +1447,8 @@ gdk_event_init (GdkDisplay *display)
   gdk_x11_event_source_add_translator ((GdkEventSource *) display_x11->event_source,
                                        GDK_EVENT_TRANSLATOR (display));
 
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-  device_manager = gdk_display_get_device_manager (display);
   gdk_x11_event_source_add_translator ((GdkEventSource *) display_x11->event_source,
-                                        GDK_EVENT_TRANSLATOR (device_manager));
-  G_GNUC_END_IGNORE_DEPRECATIONS;
+                                        GDK_EVENT_TRANSLATOR (display_x11->device_manager));
 }
 
 static void
@@ -1566,7 +1562,7 @@ gdk_x11_display_open (const gchar *display_name)
    */
   _gdk_x11_xsettings_init (GDK_X11_SCREEN (display_x11->screen));
 
-  display->device_manager = _gdk_x11_device_manager_new (display);
+  display_x11->device_manager = _gdk_x11_device_manager_new (display);
 
   gdk_event_init (display);
 
diff --git a/gdk/x11/gdkdisplay-x11.h b/gdk/x11/gdkdisplay-x11.h
index adee9f2..82b3c1e 100644
--- a/gdk/x11/gdkdisplay-x11.h
+++ b/gdk/x11/gdkdisplay-x11.h
@@ -41,6 +41,7 @@ struct _GdkX11Display
   GdkX11Screen *screen;
   GList *screens;
   GList *toplevels;
+  GdkDeviceManager *device_manager;
 
   GSource *event_source;
 


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