[gtk+/wip/matthiasc/kill-device-manager] Drop GdkDeviceManager entirely
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/matthiasc/kill-device-manager] Drop GdkDeviceManager entirely
- Date: Sat, 25 Nov 2017 04:56:08 +0000 (UTC)
commit 58b0152801e4cc2564fdedfb5f82e0e22462619d
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Nov 24 23:53:59 2017 -0500
Drop GdkDeviceManager entirely
Make the backend implementations derive from GObject,
and drop the frontend GdkDeviceManager class - it is
no longer needed.
gdk/gdk.h | 1 -
gdk/gdkdevice.c | 20 ----
gdk/gdkdevicemanager.c | 158 -----------------------------
gdk/gdkdevicemanager.h | 40 -------
gdk/gdkdevicemanagerprivate.h | 45 --------
gdk/gdkdeviceprivate.h | 2 -
gdk/meson.build | 2 -
gdk/quartz/gdkdevicemanager-core-quartz.c | 12 +--
gdk/quartz/gdkdevicemanager-core-quartz.h | 2 +-
gdk/wayland/gdkdevice-wayland.c | 59 ++++-------
gdk/wayland/gdkdisplay-wayland.c | 1 -
gdk/wayland/gdkdisplay-wayland.h | 6 +-
gdk/wayland/gdkprivate-wayland.h | 20 ++--
gdk/wayland/gdkwaylanddevice.h | 2 +
gdk/x11/gdkdevicemanager-core-x11.c | 8 +-
gdk/x11/gdkdevicemanager-x11.c | 10 +-
gdk/x11/gdkdevicemanager-xi2.c | 24 ++---
gdk/x11/gdkdisplay-x11.c | 1 -
gdk/x11/gdkprivate-x11.h | 2 +-
gdk/x11/gdkx11devicemanager.h | 5 +-
20 files changed, 63 insertions(+), 357 deletions(-)
---
diff --git a/gdk/gdk.h b/gdk/gdk.h
index 296720c..4b9a5ad 100644
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -36,7 +36,6 @@
#include <gdk/gdkdevice.h>
#include <gdk/gdkdevicepad.h>
#include <gdk/gdkdevicetool.h>
-#include <gdk/gdkdevicemanager.h>
#include <gdk/gdkdisplay.h>
#include <gdk/gdkdisplaymanager.h>
#include <gdk/gdkdnd.h>
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index c22de2a..d294588 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -82,7 +82,6 @@ G_DEFINE_ABSTRACT_TYPE (GdkDevice, gdk_device, G_TYPE_OBJECT)
enum {
PROP_0,
PROP_DISPLAY,
- PROP_DEVICE_MANAGER,
PROP_NAME,
PROP_ASSOCIATED_DEVICE,
PROP_TYPE,
@@ -126,19 +125,6 @@ gdk_device_class_init (GdkDeviceClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
/**
- * GdkDevice:device-manager:
- *
- * The #GdkDeviceManager the #GdkDevice pertains to.
- *
- * Since: 3.0
- */
- device_props[PROP_DEVICE_MANAGER] =
- g_param_spec_object ("device-manager",
- P_("Device manager"),
- P_("Device manager which the device belongs to"),
- GDK_TYPE_DEVICE_MANAGER,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
- /**
* GdkDevice:name:
*
* The device name.
@@ -432,9 +418,6 @@ gdk_device_set_property (GObject *object,
case PROP_DISPLAY:
device->display = g_value_get_object (value);
break;
- case PROP_DEVICE_MANAGER:
- device->manager = g_value_get_object (value);
- break;
case PROP_NAME:
g_free (device->name);
@@ -483,9 +466,6 @@ gdk_device_get_property (GObject *object,
case PROP_DISPLAY:
g_value_set_object (value, device->display);
break;
- case PROP_DEVICE_MANAGER:
- g_value_set_object (value, device->manager);
- break;
case PROP_ASSOCIATED_DEVICE:
g_value_set_object (value, device->associated);
break;
diff --git a/gdk/gdkdeviceprivate.h b/gdk/gdkdeviceprivate.h
index e6dcd6c..1f6392f 100644
--- a/gdk/gdkdeviceprivate.h
+++ b/gdk/gdkdeviceprivate.h
@@ -20,7 +20,6 @@
#include "gdkdevice.h"
#include "gdkdevicetool.h"
-#include "gdkdevicemanager.h"
#include "gdkevents.h"
#include "gdkseat.h"
@@ -50,7 +49,6 @@ struct _GdkDevice
gint num_keys;
GdkAxisFlags axis_flags;
GdkDeviceKey *keys;
- GdkDeviceManager *manager;
GdkDisplay *display;
/* Paired master for master,
* associated master for slaves
diff --git a/gdk/meson.build b/gdk/meson.build
index 9b34ee4..8792f34 100644
--- a/gdk/meson.build
+++ b/gdk/meson.build
@@ -5,7 +5,6 @@ gdk_public_sources = files([
'gdkcontentformats.c',
'gdkcursor.c',
'gdkdevice.c',
- 'gdkdevicemanager.c',
'gdkdevicepad.c',
'gdkdevicetool.c',
'gdkdisplay.c',
@@ -45,7 +44,6 @@ gdk_public_headers = files([
'gdkcontentformats.h',
'gdkcursor.h',
'gdkdevice.h',
- 'gdkdevicemanager.h',
'gdkdevicepad.h',
'gdkdevicetool.h',
'gdkdisplay.h',
diff --git a/gdk/quartz/gdkdevicemanager-core-quartz.c b/gdk/quartz/gdkdevicemanager-core-quartz.c
index 834f85f..d7be501 100644
--- a/gdk/quartz/gdkdevicemanager-core-quartz.c
+++ b/gdk/quartz/gdkdevicemanager-core-quartz.c
@@ -37,7 +37,7 @@ static void gdk_quartz_device_manager_core_constructed (GObject *object);
static GdkDevice * gdk_quartz_device_manager_core_get_client_pointer (GdkDeviceManager *device_manager);
-G_DEFINE_TYPE (GdkQuartzDeviceManagerCore, gdk_quartz_device_manager_core, GDK_TYPE_DEVICE_MANAGER)
+G_DEFINE_TYPE (GdkQuartzDeviceManagerCore, gdk_quartz_device_manager_core, G_TYPE_OBJECT)
static void
@@ -78,12 +78,10 @@ gdk_device_manager_get_property (GObject *object,
static void
gdk_quartz_device_manager_core_class_init (GdkQuartzDeviceManagerCoreClass *klass)
{
- GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
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;
@@ -97,8 +95,8 @@ gdk_quartz_device_manager_core_class_init (GdkQuartzDeviceManagerCoreClass *klas
}
static GdkDevice *
-create_core_pointer (GdkDeviceManager *device_manager,
- GdkDisplay *display)
+create_core_pointer (GdkQuartzDeviceManagerCore *device_manager,
+ GdkDisplay *display)
{
return g_object_new (GDK_TYPE_QUARTZ_DEVICE_CORE,
"name", "Core Pointer",
@@ -112,8 +110,8 @@ create_core_pointer (GdkDeviceManager *device_manager,
}
static GdkDevice *
-create_core_keyboard (GdkDeviceManager *device_manager,
- GdkDisplay *display)
+create_core_keyboard (GdkQuartzDeviceManagerCore *device_manager,
+ GdkDisplay *display)
{
return g_object_new (GDK_TYPE_QUARTZ_DEVICE_CORE,
"name", "Core Keyboard",
diff --git a/gdk/quartz/gdkdevicemanager-core-quartz.h b/gdk/quartz/gdkdevicemanager-core-quartz.h
index 02ec780..a4a054d 100644
--- a/gdk/quartz/gdkdevicemanager-core-quartz.h
+++ b/gdk/quartz/gdkdevicemanager-core-quartz.h
@@ -35,7 +35,7 @@ struct _GdkQuartzDeviceManagerCore
struct _GdkQuartzDeviceManagerCoreClass
{
- GdkDeviceManagerClass parent_class;
+ GObjectClass parent_class;
};
G_END_DECLS
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 02051a8..2058116 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -32,7 +32,6 @@
#include "gdkdeviceprivate.h"
#include "gdkdevicepadprivate.h"
#include "gdkdevicetoolprivate.h"
-#include "gdkdevicemanagerprivate.h"
#include "gdkseatprivate.h"
#include "pointer-gestures-unstable-v1-client-protocol.h"
#include "tablet-unstable-v2-client-protocol.h"
@@ -192,7 +191,7 @@ struct _GdkWaylandSeat
struct zwp_tablet_seat_v2 *wp_tablet_seat;
GdkDisplay *display;
- GdkDeviceManager *device_manager;
+ GdkWaylandDeviceManager *device_manager;
GdkDevice *master_pointer;
GdkDevice *master_keyboard;
@@ -297,13 +296,13 @@ typedef struct _GdkWaylandDeviceManagerClass GdkWaylandDeviceManagerClass;
struct _GdkWaylandDeviceManager
{
- GdkDeviceManager parent_object;
+ GObject parent_instance;
GList *devices;
};
struct _GdkWaylandDeviceManagerClass
{
- GdkDeviceManagerClass parent_class;
+ GObjectClass parent_class;
};
static void deliver_key_event (GdkWaylandSeat *seat,
@@ -313,8 +312,7 @@ static void deliver_key_event (GdkWaylandSeat *seat,
gboolean from_key_repeat);
GType gdk_wayland_device_manager_get_type (void);
-G_DEFINE_TYPE (GdkWaylandDeviceManager,
- gdk_wayland_device_manager, GDK_TYPE_DEVICE_MANAGER)
+G_DEFINE_TYPE (GdkWaylandDeviceManager, gdk_wayland_device_manager, G_TYPE_OBJECT)
static gboolean
gdk_wayland_device_get_history (GdkDevice *device,
@@ -2760,8 +2758,7 @@ static void
_gdk_wayland_seat_remove_tablet (GdkWaylandSeat *seat,
GdkWaylandTabletData *tablet)
{
- GdkWaylandDeviceManager *device_manager =
- GDK_WAYLAND_DEVICE_MANAGER (seat->device_manager);
+ GdkWaylandDeviceManager *device_manager = seat->device_manager;
seat->tablets = g_list_remove (seat->tablets, tablet);
@@ -2795,8 +2792,7 @@ static void
_gdk_wayland_seat_remove_tablet_pad (GdkWaylandSeat *seat,
GdkWaylandTabletPadData *pad)
{
- GdkWaylandDeviceManager *device_manager =
- GDK_WAYLAND_DEVICE_MANAGER (seat->device_manager);
+ GdkWaylandDeviceManager *device_manager = seat->device_manager;
seat->tablet_pads = g_list_remove (seat->tablet_pads, pad);
@@ -2866,8 +2862,7 @@ tablet_handle_done (void *data,
GdkWaylandTabletData *tablet = data;
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
GdkDisplay *display = gdk_seat_get_display (GDK_SEAT (seat));
- GdkWaylandDeviceManager *device_manager =
- GDK_WAYLAND_DEVICE_MANAGER (seat->device_manager);
+ GdkWaylandDeviceManager *device_manager = seat->device_manager;
GdkDevice *master, *stylus_device, *eraser_device;
gchar *master_name, *eraser_name;
gchar *vid, *pid;
@@ -2883,7 +2878,6 @@ tablet_handle_done (void *data,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", TRUE,
"display", display,
- "device-manager", device_manager,
"seat", seat,
NULL);
GDK_WAYLAND_DEVICE (master)->pointer = &tablet->pointer_info;
@@ -2897,7 +2891,6 @@ tablet_handle_done (void *data,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", FALSE,
"display", display,
- "device-manager", device_manager,
"seat", seat,
"vendor-id", vid,
"product-id", pid,
@@ -2910,7 +2903,6 @@ tablet_handle_done (void *data,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", FALSE,
"display", display,
- "device-manager", device_manager,
"seat", seat,
"vendor-id", vid,
"product-id", pid,
@@ -3002,7 +2994,7 @@ seat_handle_capabilities (void *data,
enum wl_seat_capability caps)
{
GdkWaylandSeat *seat = data;
- GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (seat->device_manager);
+ GdkWaylandDeviceManager *device_manager = seat->device_manager;
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
GDK_NOTE (MISC,
@@ -3024,7 +3016,6 @@ seat_handle_capabilities (void *data,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", TRUE,
"display", seat->display,
- "device-manager", seat->device_manager,
"seat", seat,
NULL);
_gdk_device_set_associated_device (seat->pointer, seat->master_pointer);
@@ -3106,7 +3097,6 @@ seat_handle_capabilities (void *data,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", FALSE,
"display", seat->display,
- "device-manager", seat->device_manager,
"seat", seat,
NULL);
_gdk_device_reset_axes (seat->keyboard);
@@ -3140,7 +3130,6 @@ seat_handle_capabilities (void *data,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", TRUE,
"display", seat->display,
- "device-manager", seat->device_manager,
"seat", seat,
NULL);
GDK_WAYLAND_DEVICE (seat->touch_master)->pointer = &seat->touch_info;
@@ -3156,7 +3145,6 @@ seat_handle_capabilities (void *data,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", FALSE,
"display", seat->display,
- "device-manager", seat->device_manager,
"seat", seat,
NULL);
_gdk_device_set_associated_device (seat->touch, seat->touch_master);
@@ -3190,7 +3178,7 @@ static GdkDevice *
get_scroll_device (GdkWaylandSeat *seat,
enum wl_pointer_axis_source source)
{
- GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (seat->device_manager);
+ GdkWaylandDeviceManager *device_manager = seat->device_manager;
if (!seat->pointer)
return NULL;
@@ -3207,7 +3195,6 @@ get_scroll_device (GdkWaylandSeat *seat,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", TRUE,
"display", seat->display,
- "device-manager", seat->device_manager,
"seat", seat,
NULL);
_gdk_device_set_associated_device (seat->wheel_scrolling, seat->master_pointer);
@@ -3227,7 +3214,6 @@ get_scroll_device (GdkWaylandSeat *seat,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", TRUE,
"display", seat->display,
- "device-manager", seat->device_manager,
"seat", seat,
NULL);
_gdk_device_set_associated_device (seat->finger_scrolling, seat->master_pointer);
@@ -3247,7 +3233,6 @@ get_scroll_device (GdkWaylandSeat *seat,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", TRUE,
"display", seat->display,
- "device-manager", seat->device_manager,
"seat", seat,
NULL);
_gdk_device_set_associated_device (seat->continuous_scrolling, seat->master_pointer);
@@ -4242,8 +4227,6 @@ tablet_pad_handle_done (void *data,
{
GdkWaylandTabletPadData *pad = data;
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
- GdkWaylandDeviceManager *device_manager =
- GDK_WAYLAND_DEVICE_MANAGER (seat->device_manager);
GDK_NOTE (EVENTS,
g_message ("tablet pad handle done, pad = %p", wp_tablet_pad));
@@ -4255,7 +4238,6 @@ tablet_pad_handle_done (void *data,
"input-source", GDK_SOURCE_TABLET_PAD,
"input-mode", GDK_MODE_SCREEN,
"display", gdk_seat_get_display (pad->seat),
- "device-manager", device_manager,
"seat", seat,
NULL);
@@ -4432,7 +4414,7 @@ static const struct zwp_tablet_seat_v2_listener tablet_seat_listener = {
static void
init_devices (GdkWaylandSeat *seat)
{
- GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (seat->device_manager);
+ GdkWaylandDeviceManager *device_manager = seat->device_manager;
/* pointer */
seat->master_pointer = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
@@ -4442,7 +4424,6 @@ init_devices (GdkWaylandSeat *seat)
"input-mode", GDK_MODE_SCREEN,
"has-cursor", TRUE,
"display", seat->display,
- "device-manager", device_manager,
"seat", seat,
NULL);
@@ -4459,7 +4440,6 @@ init_devices (GdkWaylandSeat *seat)
"input-mode", GDK_MODE_SCREEN,
"has-cursor", FALSE,
"display", seat->display,
- "device-manager", device_manager,
"seat", seat,
NULL);
_gdk_device_reset_axes (seat->master_keyboard);
@@ -4894,10 +4874,10 @@ 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)
+_gdk_wayland_device_manager_add_seat (GdkWaylandDeviceManager *device_manager,
+ GdkDisplay *display,
+ guint32 id,
+ struct wl_seat *wl_seat)
{
GdkWaylandDisplay *display_wayland;
GdkWaylandSeat *seat;
@@ -4911,8 +4891,7 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
seat->keymap = _gdk_wayland_keymap_new ();
seat->display = display;
seat->device_manager = device_manager;
- seat->touches = g_hash_table_new_full (NULL, NULL, NULL,
- (GDestroyNotify) g_free);
+ seat->touches = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_free);
seat->foreign_dnd_window = create_foreign_dnd_window (display);
seat->wl_seat = wl_seat;
@@ -4960,9 +4939,9 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
}
void
-_gdk_wayland_device_manager_remove_seat (GdkDeviceManager *manager,
- GdkDisplay *display,
- guint32 id)
+_gdk_wayland_device_manager_remove_seat (GdkWaylandDeviceManager *manager,
+ GdkDisplay *display,
+ guint32 id)
{
GList *l, *seats;
@@ -5013,7 +4992,7 @@ gdk_wayland_device_manager_init (GdkWaylandDeviceManager *device_manager)
{
}
-GdkDeviceManager *
+GdkWaylandDeviceManager *
_gdk_wayland_device_manager_new (GdkDisplay *display)
{
return g_object_new (GDK_TYPE_WAYLAND_DEVICE_MANAGER, NULL);
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index d909106..16d6e96 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -40,7 +40,6 @@
#include "gdkmonitor-wayland.h"
#include "gdkinternals.h"
#include "gdkdeviceprivate.h"
-#include "gdkdevicemanager.h"
#include "gdkkeysprivate.h"
#include "gdkprivate-wayland.h"
#include "gdkglcontext-wayland.h"
diff --git a/gdk/wayland/gdkdisplay-wayland.h b/gdk/wayland/gdkdisplay-wayland.h
index 2832eb8..d972c32 100644
--- a/gdk/wayland/gdkdisplay-wayland.h
+++ b/gdk/wayland/gdkdisplay-wayland.h
@@ -22,7 +22,8 @@
#ifndef __GDK_WAYLAND_DISPLAY__
#define __GDK_WAYLAND_DISPLAY__
-#include <config.h>
+#include "config.h"
+
#include <stdint.h>
#include <wayland-client.h>
#include <wayland-cursor.h>
@@ -41,6 +42,7 @@
#include <gdk/gdk.h> /* For gdk_get_program_class() */
#include "gdkdisplayprivate.h"
+#include "gdkwaylanddevice.h"
#include <epoxy/egl.h>
@@ -66,7 +68,7 @@ struct _GdkWaylandDisplay
GdkDisplay parent_instance;
GList *toplevels;
- GdkDeviceManager *device_manager;
+ GdkWaylandDeviceManager *device_manager;
GHashTable *settings;
GsdXftSettings xft_settings;
diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h
index b56ca7d..87d5901 100644
--- a/gdk/wayland/gdkprivate-wayland.h
+++ b/gdk/wayland/gdkprivate-wayland.h
@@ -29,6 +29,8 @@
#ifndef __GDK_PRIVATE_WAYLAND_H__
#define __GDK_PRIVATE_WAYLAND_H__
+#include "config.h"
+
#include <gdk/gdkcursor.h>
#include <gdk/wayland/gdkwayland.h>
#include <gdk/wayland/gdkdisplay-wayland.h>
@@ -38,7 +40,7 @@
#include "gdkinternals.h"
#include "wayland/gtk-primary-selection-client-protocol.h"
-#include "config.h"
+typedef struct _GdkWaylandDeviceManager GdkWaylandDeviceManager;
#define WL_SURFACE_HAS_BUFFER_SCALE 3
#define WL_POINTER_HAS_FRAME 5
@@ -169,14 +171,14 @@ gint _gdk_wayland_display_text_property_to_utf8_list (GdkDisplay *disp
gchar * _gdk_wayland_display_utf8_to_string_target (GdkDisplay *display,
const gchar *str);
-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);
+GdkWaylandDeviceManager *_gdk_wayland_device_manager_new (GdkDisplay *display);
+void _gdk_wayland_device_manager_add_seat (GdkWaylandDeviceManager *device_manager,
+ GdkDisplay *display,
+ guint32 id,
+ struct wl_seat *seat);
+void _gdk_wayland_device_manager_remove_seat (GdkWaylandDeviceManager *device_manager,
+ GdkDisplay *display,
+ guint32 id);
GdkKeymap *_gdk_wayland_device_get_keymap (GdkDevice *device);
uint32_t _gdk_wayland_device_get_implicit_grab_serial(GdkWaylandDevice *device,
diff --git a/gdk/wayland/gdkwaylanddevice.h b/gdk/wayland/gdkwaylanddevice.h
index e7a3b9a..6ba4313 100644
--- a/gdk/wayland/gdkwaylanddevice.h
+++ b/gdk/wayland/gdkwaylanddevice.h
@@ -42,6 +42,8 @@ typedef struct _GdkWaylandDeviceClass GdkWaylandDeviceClass;
#define GDK_IS_WAYLAND_DEVICE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_WAYLAND_DEVICE))
#define GDK_WAYLAND_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_WAYLAND_DEVICE,
GdkWaylandDeviceClass))
+typedef struct _GdkWaylandDeviceManager GdkWaylandDeviceManager;
+
GDK_AVAILABLE_IN_ALL
GType gdk_wayland_device_get_type (void);
diff --git a/gdk/x11/gdkdevicemanager-core-x11.c b/gdk/x11/gdkdevicemanager-core-x11.c
index fa3f92d..76914f1 100644
--- a/gdk/x11/gdkdevicemanager-core-x11.c
+++ b/gdk/x11/gdkdevicemanager-core-x11.c
@@ -125,7 +125,6 @@ create_core_pointer (GdkX11DeviceManagerCore *device_manager,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", TRUE,
"display", display,
- "device-manager", device_manager,
NULL);
}
@@ -140,7 +139,6 @@ create_core_keyboard (GdkX11DeviceManagerCore *device_manager,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", FALSE,
"display", display,
- "device-manager", device_manager,
NULL);
}
@@ -338,12 +336,10 @@ static GdkWindow *
get_event_window (GdkEventTranslator *translator,
XEvent *xevent)
{
- GdkDeviceManager *device_manager;
GdkDisplay *display;
GdkWindow *window;
- device_manager = GDK_DEVICE_MANAGER (translator);
- display = GDK_X11_DEVICE_MANAGER_CORE (device_manager)->display;
+ display = GDK_X11_DEVICE_MANAGER_CORE (translator)->display;
window = gdk_x11_window_lookup_for_display (display, xevent->xany.window);
/* Apply keyboard grabs to non-native windows */
@@ -354,7 +350,7 @@ get_event_window (GdkEventTranslator *translator,
serial = _gdk_display_get_next_serial (display);
info = _gdk_display_has_device_grab (display,
- GDK_X11_DEVICE_MANAGER_CORE (device_manager)->core_keyboard,
+ GDK_X11_DEVICE_MANAGER_CORE (translator)->core_keyboard,
serial);
if (info &&
(!is_parent_of (info->window, window) ||
diff --git a/gdk/x11/gdkdevicemanager-x11.c b/gdk/x11/gdkdevicemanager-x11.c
index 8903675..ecc8ef8 100644
--- a/gdk/x11/gdkdevicemanager-x11.c
+++ b/gdk/x11/gdkdevicemanager-x11.c
@@ -33,7 +33,7 @@
static gboolean _gdk_disable_multidevice = FALSE;
-GdkDeviceManager *
+GdkX11DeviceManagerCore *
_gdk_x11_device_manager_new (GdkDisplay *display)
{
if (!g_getenv ("GDK_CORE_DEVICE_EVENTS"))
@@ -66,7 +66,7 @@ _gdk_x11_device_manager_new (GdkDisplay *display)
"minor", minor,
NULL);
- return GDK_DEVICE_MANAGER (device_manager_xi2);
+ return GDK_X11_DEVICE_MANAGER_CORE (device_manager_xi2);
}
}
#endif /* XINPUT_2 */
@@ -92,12 +92,12 @@ _gdk_x11_device_manager_new (GdkDisplay *display)
* Since: 3.2
**/
GdkDevice *
-gdk_x11_device_manager_lookup (GdkDeviceManager *device_manager,
- gint device_id)
+gdk_x11_device_manager_lookup (GdkX11DeviceManagerCore *device_manager,
+ gint device_id)
{
GdkDevice *device = NULL;
- g_return_val_if_fail (GDK_IS_DEVICE_MANAGER (device_manager), NULL);
+ g_return_val_if_fail (GDK_IS_X11_DEVICE_MANAGER_CORE (device_manager), NULL);
#ifdef XINPUT_2
if (GDK_IS_X11_DEVICE_MANAGER_XI2 (device_manager))
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 55733bc..f905496 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -140,9 +140,9 @@ gdk_x11_device_manager_xi2_init (GdkX11DeviceManagerXI2 *device_manager)
}
static void
-_gdk_x11_device_manager_xi2_select_events (GdkDeviceManager *device_manager,
- Window xwindow,
- XIEventMask *event_mask)
+_gdk_x11_device_manager_xi2_select_events (GdkX11DeviceManagerXI2 *device_manager,
+ Window xwindow,
+ XIEventMask *event_mask)
{
GdkDisplay *display;
Display *xdisplay;
@@ -402,9 +402,9 @@ is_touchpad_device (GdkDisplay *display,
}
static GdkDevice *
-create_device (GdkDeviceManager *device_manager,
- GdkDisplay *display,
- XIDeviceInfo *dev)
+create_device (GdkX11DeviceManagerXI2 *device_manager,
+ GdkDisplay *display,
+ XIDeviceInfo *dev)
{
GdkInputSource input_source;
GdkInputSource touch_source;
@@ -496,7 +496,6 @@ create_device (GdkDeviceManager *device_manager,
"input-mode", mode,
"has-cursor", (dev->use == XIMasterPointer),
"display", display,
- "device-manager", device_manager,
"device-id", dev->deviceid,
"vendor-id", vendor_id,
"product-id", product_id,
@@ -550,7 +549,7 @@ add_device (GdkX11DeviceManagerXI2 *device_manager,
GdkDevice *device;
display = GDK_X11_DEVICE_MANAGER_CORE (device_manager)->display;
- device = create_device (GDK_DEVICE_MANAGER (device_manager), display, dev);
+ device = create_device (device_manager, display, dev);
g_hash_table_replace (device_manager->id_table,
GINT_TO_POINTER (dev->deviceid),
@@ -737,7 +736,7 @@ gdk_x11_device_manager_xi2_constructed (GObject *object)
event_mask.mask_len = sizeof (mask);
event_mask.mask = mask;
- _gdk_x11_device_manager_xi2_select_events (GDK_DEVICE_MANAGER (object),
+ _gdk_x11_device_manager_xi2_select_events (device_manager,
GDK_DISPLAY_XROOTWIN (display),
&event_mask);
}
@@ -1933,17 +1932,14 @@ gdk_x11_device_manager_xi2_select_window_events (GdkEventTranslator *translator,
Window window,
GdkEventMask evmask)
{
- GdkDeviceManager *device_manager;
XIEventMask event_mask;
- device_manager = GDK_DEVICE_MANAGER (translator);
-
event_mask.deviceid = XIAllMasterDevices;
- event_mask.mask = _gdk_x11_device_xi2_translate_event_mask (GDK_X11_DEVICE_MANAGER_XI2 (device_manager),
+ event_mask.mask = _gdk_x11_device_xi2_translate_event_mask (GDK_X11_DEVICE_MANAGER_XI2 (translator),
evmask,
&event_mask.mask_len);
- _gdk_x11_device_manager_xi2_select_events (device_manager, window, &event_mask);
+ _gdk_x11_device_manager_xi2_select_events (GDK_X11_DEVICE_MANAGER_XI2 (translator), window, &event_mask);
g_free (event_mask.mask);
}
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 351dffa..a055056 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -33,7 +33,6 @@
#include "gdkinternals.h"
#include "gdkdeviceprivate.h"
#include "gdkkeysprivate.h"
-#include "gdkdevicemanager.h"
#include "xsettings-client.h"
#include "gdkdisplay-x11.h"
#include "gdkprivate-x11.h"
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index b594e86..f163e9b 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -194,7 +194,7 @@ gchar * _gdk_x11_display_utf8_to_string_target (GdkDisplay *display
void _gdk_x11_device_check_extension_events (GdkDevice *device);
-GdkDeviceManager *_gdk_x11_device_manager_new (GdkDisplay *display);
+GdkX11DeviceManagerCore *_gdk_x11_device_manager_new (GdkDisplay *display);
#ifdef XINPUT_2
guchar * _gdk_x11_device_xi2_translate_event_mask (GdkX11DeviceManagerXI2 *device_manager_xi2,
diff --git a/gdk/x11/gdkx11devicemanager.h b/gdk/x11/gdkx11devicemanager.h
index 67ef483..5b24e63 100644
--- a/gdk/x11/gdkx11devicemanager.h
+++ b/gdk/x11/gdkx11devicemanager.h
@@ -23,6 +23,7 @@
#endif
#include <gdk/gdk.h>
+#include <gdk/x11/gdkx11devicemanager-core.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -30,8 +31,8 @@
G_BEGIN_DECLS
GDK_AVAILABLE_IN_3_2
-GdkDevice * gdk_x11_device_manager_lookup (GdkDeviceManager *device_manager,
- gint device_id);
+GdkDevice * gdk_x11_device_manager_lookup (GdkX11DeviceManagerCore *device_manager,
+ gint device_id);
GDK_AVAILABLE_IN_ALL
void gdk_disable_multidevice (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]