diff options
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/gdkdevicemanager.c | 82 | ||||
-rw-r--r-- | gdk/gdkdevicemanager.h | 2 | ||||
-rw-r--r-- | gdk/gdkdevicemanagerprivate.h | 3 | ||||
-rw-r--r-- | gdk/quartz/gdkdevicemanager-core-quartz.c | 49 | ||||
-rw-r--r-- | gdk/quartz/gdkdevicemanager-core-quartz.h | 3 | ||||
-rw-r--r-- | gdk/wayland/gdkdevice-wayland.c | 43 | ||||
-rw-r--r-- | gdk/wayland/gdkdisplay-wayland.c | 5 | ||||
-rw-r--r-- | gdk/wayland/gdkprivate-wayland.h | 2 | ||||
-rw-r--r-- | gdk/x11/gdkdevicemanager-core-x11.c | 70 | ||||
-rw-r--r-- | gdk/x11/gdkdevicemanager-xi2.c | 19 | ||||
-rw-r--r-- | gdk/x11/gdkdevicemanagerprivate-core.h | 6 |
11 files changed, 149 insertions, 135 deletions
diff --git a/gdk/gdkdevicemanager.c b/gdk/gdkdevicemanager.c index bd22b491d8..d60ac6f721 100644 --- a/gdk/gdkdevicemanager.c +++ b/gdk/gdkdevicemanager.c @@ -144,97 +144,15 @@ * written code. */ -static void gdk_device_manager_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static void gdk_device_manager_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); - - G_DEFINE_ABSTRACT_TYPE (GdkDeviceManager, gdk_device_manager, G_TYPE_OBJECT) -enum { - PROP_0, - PROP_DISPLAY -}; - static void gdk_device_manager_class_init (GdkDeviceManagerClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->set_property = gdk_device_manager_set_property; - object_class->get_property = gdk_device_manager_get_property; - - g_object_class_install_property (object_class, - PROP_DISPLAY, - g_param_spec_object ("display", - P_("Display"), - P_("Display for the device manager"), - GDK_TYPE_DISPLAY, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | - G_PARAM_STATIC_STRINGS)); } static void gdk_device_manager_init (GdkDeviceManager *device_manager) { } - -static void -gdk_device_manager_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - switch (prop_id) - { - case PROP_DISPLAY: - GDK_DEVICE_MANAGER (object)->display = g_value_get_object (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -gdk_device_manager_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - - switch (prop_id) - { - case PROP_DISPLAY: - g_value_set_object (value, GDK_DEVICE_MANAGER (object)->display); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -/** - * gdk_device_manager_get_display: - * @device_manager: a #GdkDeviceManager - * - * Gets the #GdkDisplay associated to @device_manager. - * - * Returns: (nullable) (transfer none): the #GdkDisplay to which - * @device_manager is associated to, or %NULL. This memory is - * owned by GDK and must not be freed or unreferenced. - * - * Since: 3.0 - **/ -GdkDisplay * -gdk_device_manager_get_display (GdkDeviceManager *device_manager) -{ - g_return_val_if_fail (GDK_IS_DEVICE_MANAGER (device_manager), NULL); - - return device_manager->display; -} diff --git a/gdk/gdkdevicemanager.h b/gdk/gdkdevicemanager.h index af6793f16a..dcc676ac79 100644 --- a/gdk/gdkdevicemanager.h +++ b/gdk/gdkdevicemanager.h @@ -34,8 +34,6 @@ G_BEGIN_DECLS GType gdk_device_manager_get_type (void) G_GNUC_CONST; -GdkDisplay * gdk_device_manager_get_display (GdkDeviceManager *device_manager); - G_END_DECLS diff --git a/gdk/gdkdevicemanagerprivate.h b/gdk/gdkdevicemanagerprivate.h index 6522e2a002..2a1f2cd79c 100644 --- a/gdk/gdkdevicemanagerprivate.h +++ b/gdk/gdkdevicemanagerprivate.h @@ -33,9 +33,6 @@ typedef struct _GdkDeviceManagerClass GdkDeviceManagerClass; struct _GdkDeviceManager { GObject parent_instance; - - /*< private >*/ - GdkDisplay *display; }; struct _GdkDeviceManagerClass diff --git a/gdk/quartz/gdkdevicemanager-core-quartz.c b/gdk/quartz/gdkdevicemanager-core-quartz.c index bded104d52..834f85fe40 100644 --- a/gdk/quartz/gdkdevicemanager-core-quartz.c +++ b/gdk/quartz/gdkdevicemanager-core-quartz.c @@ -39,6 +39,42 @@ static GdkDevice * gdk_quartz_device_manager_core_get_client_pointer (GdkDeviceM G_DEFINE_TYPE (GdkQuartzDeviceManagerCore, gdk_quartz_device_manager_core, GDK_TYPE_DEVICE_MANAGER) + +static void +gdk_device_manager_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (prop_id) + { + case PROP_DISPLAY: + GDK_QUARTZ_DEVICE_MANAGER_CORE (object)->display = g_value_get_object (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdk_device_manager_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + + switch (prop_id) + { + case PROP_DISPLAY: + g_value_set_object (value, GDK_QUARTZ_DEVICE_MANAGER_CORE (object)->display); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + static void gdk_quartz_device_manager_core_class_init (GdkQuartzDeviceManagerCoreClass *klass) { @@ -47,6 +83,17 @@ gdk_quartz_device_manager_core_class_init (GdkQuartzDeviceManagerCoreClass *klas object_class->finalize = gdk_quartz_device_manager_core_finalize; object_class->constructed = gdk_quartz_device_manager_core_constructed; + + object_class->set_property = gdk_device_manager_set_property; + object_class->get_property = gdk_device_manager_get_property; + + g_object_class_install_property (object_class, + PROP_DISPLAY, + g_param_spec_object ("display", + P_("Display"), + P_("Display for the device manager"), + GDK_TYPE_DISPLAY, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | } static GdkDevice * @@ -105,7 +152,7 @@ gdk_quartz_device_manager_core_constructed (GObject *object) GdkSeat *seat; device_manager = GDK_QUARTZ_DEVICE_MANAGER_CORE (object); - display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (object)); + display = device_manager->display; device_manager->core_pointer = create_core_pointer (GDK_DEVICE_MANAGER (device_manager), display); device_manager->core_keyboard = create_core_keyboard (GDK_DEVICE_MANAGER (device_manager), display); diff --git a/gdk/quartz/gdkdevicemanager-core-quartz.h b/gdk/quartz/gdkdevicemanager-core-quartz.h index db054ad685..02ec780095 100644 --- a/gdk/quartz/gdkdevicemanager-core-quartz.h +++ b/gdk/quartz/gdkdevicemanager-core-quartz.h @@ -27,7 +27,8 @@ G_BEGIN_DECLS struct _GdkQuartzDeviceManagerCore { - GdkDeviceManager parent_object; + GObject parent_object; + GdkDisplay *display; GdkDevice *core_pointer; GdkDevice *core_keyboard; }; diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index 5ee91a3803..02051a8f63 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -358,8 +358,8 @@ gdk_wayland_pointer_stop_cursor_animation (GdkWaylandPointerData *pointer) } static GdkWaylandTabletData * -gdk_wayland_device_manager_find_tablet (GdkWaylandSeat *seat, - GdkDevice *device) +gdk_wayland_seat_find_tablet (GdkWaylandSeat *seat, + GdkDevice *device) { GList *l; @@ -377,8 +377,8 @@ gdk_wayland_device_manager_find_tablet (GdkWaylandSeat *seat, } static GdkWaylandTabletPadData * -gdk_wayland_device_manager_find_pad (GdkWaylandSeat *seat, - GdkDevice *device) +gdk_wayland_seat_find_pad (GdkWaylandSeat *seat, + GdkDevice *device) { GList *l; @@ -405,7 +405,7 @@ gdk_wayland_device_update_window_cursor (GdkDevice *device) gboolean retval = G_SOURCE_REMOVE; GdkWaylandTabletData *tablet; - tablet = gdk_wayland_device_manager_find_tablet (seat, device); + tablet = gdk_wayland_seat_find_tablet (seat, device); if (pointer->cursor) { @@ -893,8 +893,8 @@ gdk_wayland_device_pad_get_n_groups (GdkDevicePad *pad) GdkSeat *seat = gdk_device_get_seat (GDK_DEVICE (pad)); GdkWaylandTabletPadData *data; - data = gdk_wayland_device_manager_find_pad (GDK_WAYLAND_SEAT (seat), - GDK_DEVICE (pad)); + data = gdk_wayland_seat_find_pad (GDK_WAYLAND_SEAT (seat), + GDK_DEVICE (pad)); g_assert (data != NULL); return g_list_length (data->mode_groups); @@ -908,8 +908,8 @@ gdk_wayland_device_pad_get_group_n_modes (GdkDevicePad *pad, GdkWaylandTabletPadGroupData *group; GdkWaylandTabletPadData *data; - data = gdk_wayland_device_manager_find_pad (GDK_WAYLAND_SEAT (seat), - GDK_DEVICE (pad)); + data = gdk_wayland_seat_find_pad (GDK_WAYLAND_SEAT (seat), + GDK_DEVICE (pad)); g_assert (data != NULL); group = g_list_nth_data (data->mode_groups, n_group); @@ -926,8 +926,8 @@ gdk_wayland_device_pad_get_n_features (GdkDevicePad *pad, GdkSeat *seat = gdk_device_get_seat (GDK_DEVICE (pad)); GdkWaylandTabletPadData *data; - data = gdk_wayland_device_manager_find_pad (GDK_WAYLAND_SEAT (seat), - GDK_DEVICE (pad)); + data = gdk_wayland_seat_find_pad (GDK_WAYLAND_SEAT (seat), + GDK_DEVICE (pad)); g_assert (data != NULL); switch (feature) @@ -954,8 +954,8 @@ gdk_wayland_device_pad_get_feature_group (GdkDevicePad *pad, GList *l; gint i; - data = gdk_wayland_device_manager_find_pad (GDK_WAYLAND_SEAT (seat), - GDK_DEVICE (pad)); + data = gdk_wayland_seat_find_pad (GDK_WAYLAND_SEAT (seat), + GDK_DEVICE (pad)); g_assert (data != NULL); for (l = data->mode_groups, i = 0; l; l = l->next, i++) @@ -4895,14 +4895,13 @@ gdk_wayland_seat_init (GdkWaylandSeat *seat) void _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager, + GdkDisplay *display, guint32 id, struct wl_seat *wl_seat) { - GdkDisplay *display; GdkWaylandDisplay *display_wayland; GdkWaylandSeat *seat; - display = gdk_device_manager_get_display (device_manager); display_wayland = GDK_WAYLAND_DISPLAY (display); seat = g_object_new (GDK_TYPE_WAYLAND_SEAT, @@ -4962,9 +4961,9 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager, void _gdk_wayland_device_manager_remove_seat (GdkDeviceManager *manager, + GdkDisplay *display, guint32 id) { - GdkDisplay *display = gdk_device_manager_get_display (manager); GList *l, *seats; seats = gdk_display_list_seats (display); @@ -5017,9 +5016,7 @@ gdk_wayland_device_manager_init (GdkWaylandDeviceManager *device_manager) GdkDeviceManager * _gdk_wayland_device_manager_new (GdkDisplay *display) { - return g_object_new (GDK_TYPE_WAYLAND_DEVICE_MANAGER, - "display", display, - NULL); + return g_object_new (GDK_TYPE_WAYLAND_DEVICE_MANAGER, NULL); } uint32_t @@ -5238,12 +5235,11 @@ gdk_wayland_device_get_node_path (GdkDevice *device) g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); seat = gdk_device_get_seat (device); - tablet = gdk_wayland_device_manager_find_tablet (GDK_WAYLAND_SEAT (seat), - device); + tablet = gdk_wayland_seat_find_tablet (GDK_WAYLAND_SEAT (seat), device); if (tablet) return tablet->path; - pad = gdk_wayland_device_manager_find_pad (GDK_WAYLAND_SEAT (seat), device); + pad = gdk_wayland_seat_find_pad (GDK_WAYLAND_SEAT (seat), device); if (pad) return pad->path; @@ -5271,8 +5267,7 @@ gdk_wayland_device_pad_set_feedback (GdkDevice *device, GdkSeat *seat; seat = gdk_device_get_seat (device); - pad = gdk_wayland_device_manager_find_pad (GDK_WAYLAND_SEAT (seat), - device); + pad = gdk_wayland_seat_find_pad (GDK_WAYLAND_SEAT (seat), device); if (!pad) return; diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c index 032a17b174..d909106ca9 100644 --- a/gdk/wayland/gdkdisplay-wayland.c +++ b/gdk/wayland/gdkdisplay-wayland.c @@ -226,6 +226,7 @@ _gdk_wayland_display_add_seat (GdkWaylandDisplay *display_wayland, id, &wl_seat_interface, display_wayland->seat_version); _gdk_wayland_device_manager_add_seat (display_wayland->device_manager, + GDK_DISPLAY (display_wayland), id, seat); _gdk_wayland_display_async_roundtrip (display_wayland); } @@ -527,7 +528,9 @@ gdk_registry_handle_global_remove (void *data, GdkWaylandDisplay *display_wayland = data; GDK_NOTE (MISC, g_message ("remove global %u", id)); - _gdk_wayland_device_manager_remove_seat (display_wayland->device_manager, id); + _gdk_wayland_device_manager_remove_seat (display_wayland->device_manager, + GDK_DISPLAY (display_wayland), + id); gdk_wayland_display_remove_output (display_wayland, id); g_hash_table_remove (display_wayland->known_globals, GUINT_TO_POINTER (id)); diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h index f987ddb3ca..b56ca7ddf4 100644 --- a/gdk/wayland/gdkprivate-wayland.h +++ b/gdk/wayland/gdkprivate-wayland.h @@ -171,9 +171,11 @@ gchar * _gdk_wayland_display_utf8_to_string_target (GdkDisplay *display, GdkDeviceManager *_gdk_wayland_device_manager_new (GdkDisplay *display); void _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager, + GdkDisplay *display, guint32 id, struct wl_seat *seat); void _gdk_wayland_device_manager_remove_seat (GdkDeviceManager *device_manager, + GdkDisplay *display, guint32 id); GdkKeymap *_gdk_wayland_device_get_keymap (GdkDevice *device); diff --git a/gdk/x11/gdkdevicemanager-core-x11.c b/gdk/x11/gdkdevicemanager-core-x11.c index fc26db264b..fa3f92d975 100644 --- a/gdk/x11/gdkdevicemanager-core-x11.c +++ b/gdk/x11/gdkdevicemanager-core-x11.c @@ -29,6 +29,7 @@ #include "gdkkeysyms.h" + #define HAS_FOCUS(toplevel) \ ((toplevel)->has_focus || (toplevel)->has_pointer_focus) @@ -43,10 +44,50 @@ static gboolean gdk_x11_device_manager_core_translate_event (GdkEventTranslator XEvent *xevent); -G_DEFINE_TYPE_WITH_CODE (GdkX11DeviceManagerCore, gdk_x11_device_manager_core, GDK_TYPE_DEVICE_MANAGER, +G_DEFINE_TYPE_WITH_CODE (GdkX11DeviceManagerCore, gdk_x11_device_manager_core, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (GDK_TYPE_EVENT_TRANSLATOR, gdk_x11_device_manager_event_translator_init)) +enum { + PROP_0, + PROP_DISPLAY +}; + +static void +gdk_device_manager_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (prop_id) + { + case PROP_DISPLAY: + GDK_X11_DEVICE_MANAGER_CORE (object)->display = g_value_get_object (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdk_device_manager_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + + switch (prop_id) + { + case PROP_DISPLAY: + g_value_set_object (value, GDK_X11_DEVICE_MANAGER_CORE (object)->display); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + static void gdk_x11_device_manager_core_class_init (GdkX11DeviceManagerCoreClass *klass) { @@ -54,6 +95,17 @@ gdk_x11_device_manager_core_class_init (GdkX11DeviceManagerCoreClass *klass) object_class->finalize = gdk_x11_device_manager_core_finalize; object_class->constructed = gdk_x11_device_manager_core_constructed; + object_class->set_property = gdk_device_manager_set_property; + object_class->get_property = gdk_device_manager_get_property; + + g_object_class_install_property (object_class, + PROP_DISPLAY, + g_param_spec_object ("display", + "Display", + "Display for the device manager", + GDK_TYPE_DISPLAY, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); } static void @@ -63,8 +115,8 @@ gdk_x11_device_manager_event_translator_init (GdkEventTranslatorIface *iface) } static GdkDevice * -create_core_pointer (GdkDeviceManager *device_manager, - GdkDisplay *display) +create_core_pointer (GdkX11DeviceManagerCore *device_manager, + GdkDisplay *display) { return g_object_new (GDK_TYPE_X11_DEVICE_CORE, "name", "Core Pointer", @@ -78,8 +130,8 @@ create_core_pointer (GdkDeviceManager *device_manager, } static GdkDevice * -create_core_keyboard (GdkDeviceManager *device_manager, - GdkDisplay *display) +create_core_keyboard (GdkX11DeviceManagerCore *device_manager, + GdkDisplay *display) { return g_object_new (GDK_TYPE_X11_DEVICE_CORE, "name", "Core Keyboard", @@ -117,9 +169,9 @@ gdk_x11_device_manager_core_constructed (GObject *object) GdkDisplay *display; device_manager = GDK_X11_DEVICE_MANAGER_CORE (object); - display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (object)); - device_manager->core_pointer = create_core_pointer (GDK_DEVICE_MANAGER (device_manager), display); - device_manager->core_keyboard = create_core_keyboard (GDK_DEVICE_MANAGER (device_manager), display); + display = device_manager->display; + device_manager->core_pointer = create_core_pointer (device_manager, display); + device_manager->core_keyboard = create_core_keyboard (device_manager, display); _gdk_device_set_associated_device (device_manager->core_pointer, device_manager->core_keyboard); _gdk_device_set_associated_device (device_manager->core_keyboard, device_manager->core_pointer); @@ -291,7 +343,7 @@ get_event_window (GdkEventTranslator *translator, GdkWindow *window; device_manager = GDK_DEVICE_MANAGER (translator); - display = gdk_device_manager_get_display (device_manager); + display = GDK_X11_DEVICE_MANAGER_CORE (device_manager)->display; window = gdk_x11_window_lookup_for_display (display, xevent->xany.window); /* Apply keyboard grabs to non-native windows */ diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c index 2819059ca6..55733bcff2 100644 --- a/gdk/x11/gdkdevicemanager-xi2.c +++ b/gdk/x11/gdkdevicemanager-xi2.c @@ -20,6 +20,7 @@ #include "gdkx11devicemanager-xi2.h" #include "gdkx11device-xi2.h" +#include "gdkx11devicemanager-core.h" #include "gdkdevicemanagerprivate-core.h" #include "gdkdeviceprivate.h" #include "gdkdevicetoolprivate.h" @@ -53,7 +54,7 @@ struct _GdkX11DeviceManagerXI2 struct _GdkX11DeviceManagerXI2Class { - GdkDeviceManagerClass parent_class; + GdkX11DeviceManagerCoreClass parent_class; }; static void gdk_x11_device_manager_xi2_event_translator_init (GdkEventTranslatorIface *iface); @@ -146,7 +147,7 @@ _gdk_x11_device_manager_xi2_select_events (GdkDeviceManager *device_manager, GdkDisplay *display; Display *xdisplay; - display = gdk_device_manager_get_display (device_manager); + display = GDK_X11_DEVICE_MANAGER_CORE (device_manager)->display; xdisplay = GDK_DISPLAY_XDISPLAY (display); XISelectEvents (xdisplay, xwindow, event_mask, 1); @@ -518,7 +519,7 @@ ensure_seat_for_device_pair (GdkX11DeviceManagerXI2 *device_manager, GdkDisplay *display; GdkSeat *seat; - display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (device_manager)); + display = GDK_X11_DEVICE_MANAGER_CORE (device_manager)->display; seat = gdk_device_get_seat (device1); if (!seat) @@ -548,7 +549,7 @@ add_device (GdkX11DeviceManagerXI2 *device_manager, GdkDisplay *display; GdkDevice *device; - display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (device_manager)); + display = GDK_X11_DEVICE_MANAGER_CORE (device_manager)->display; device = create_device (GDK_DEVICE_MANAGER (device_manager), display, dev); g_hash_table_replace (device_manager->id_table, @@ -682,7 +683,7 @@ gdk_x11_device_manager_xi2_constructed (GObject *object) G_OBJECT_CLASS (gdk_x11_device_manager_xi2_parent_class)->constructed (object); device_manager = GDK_X11_DEVICE_MANAGER_XI2 (object); - display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (object)); + display = GDK_X11_DEVICE_MANAGER_CORE (device_manager)->display; xdisplay = GDK_DISPLAY_XDISPLAY (display); g_assert (device_manager->major == 2); @@ -768,7 +769,7 @@ gdk_x11_device_manager_xi2_get_client_pointer (GdkDeviceManager *device_manager) int device_id; device_manager_xi2 = (GdkX11DeviceManagerXI2 *) device_manager; - display = gdk_device_manager_get_display (device_manager); + display = GDK_X11_DEVICE_MANAGER_CORE (device_manager)->display; XIGetClientPointer (GDK_DISPLAY_XDISPLAY (display), None, &device_id); @@ -850,7 +851,7 @@ handle_hierarchy_changed (GdkX11DeviceManagerXI2 *device_manager, int ndevices; gint i; - display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (device_manager)); + display = GDK_X11_DEVICE_MANAGER_CORE (device_manager)->display; xdisplay = GDK_DISPLAY_XDISPLAY (display); for (i = 0; i < ev->num_info; i++) @@ -925,7 +926,7 @@ handle_device_changed (GdkX11DeviceManagerXI2 *device_manager, GdkDisplay *display; GdkDevice *device, *source_device; - display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (device_manager)); + display = GDK_X11_DEVICE_MANAGER_CORE (device_manager)->display; device = g_hash_table_lookup (device_manager->id_table, GUINT_TO_POINTER (ev->deviceid)); source_device = g_hash_table_lookup (device_manager->id_table, @@ -1158,7 +1159,7 @@ get_event_window (GdkEventTranslator *translator, GdkWindow *window = NULL; gboolean should_have_window = TRUE; - display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (translator)); + display = GDK_X11_DEVICE_MANAGER_CORE (translator)->display; switch (ev->evtype) { diff --git a/gdk/x11/gdkdevicemanagerprivate-core.h b/gdk/x11/gdkdevicemanagerprivate-core.h index 4de19d1e8f..55aa45c748 100644 --- a/gdk/x11/gdkdevicemanagerprivate-core.h +++ b/gdk/x11/gdkdevicemanagerprivate-core.h @@ -21,20 +21,20 @@ #include <X11/Xlib.h> #include "gdkx11devicemanager-core.h" -#include "gdkdevicemanagerprivate.h" G_BEGIN_DECLS struct _GdkX11DeviceManagerCore { - GdkDeviceManager parent_object; + GObject parent_instance; + GdkDisplay *display; GdkDevice *core_pointer; GdkDevice *core_keyboard; }; struct _GdkX11DeviceManagerCoreClass { - GdkDeviceManagerClass parent_class; + GObjectClass parent_class; }; void _gdk_device_manager_core_handle_focus (GdkWindow *window, |