summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdk/broadway/gdkdisplay-broadway.c50
-rw-r--r--gdk/broadway/gdkdisplay-broadway.h4
-rw-r--r--gdk/gdkdisplay.c39
-rw-r--r--gdk/gdkdisplayprivate.h2
-rw-r--r--gdk/quartz/gdkdisplay-quartz.c51
-rw-r--r--gdk/wayland/gdkdisplay-wayland.c29
-rw-r--r--gdk/wayland/gdkdisplay-wayland.h3
-rw-r--r--gdk/win32/gdkdisplay-win32.c38
-rw-r--r--gdk/win32/gdkdisplay-win32.h2
-rw-r--r--gdk/x11/gdkdisplay-x11.c52
-rw-r--r--gdk/x11/gdkdisplay-x11.h4
11 files changed, 46 insertions, 228 deletions
diff --git a/gdk/broadway/gdkdisplay-broadway.c b/gdk/broadway/gdkdisplay-broadway.c
index c5f64286e2..2aa56c6a9d 100644
--- a/gdk/broadway/gdkdisplay-broadway.c
+++ b/gdk/broadway/gdkdisplay-broadway.c
@@ -66,42 +66,6 @@ gdk_event_init (GdkDisplay *display)
broadway_display->event_source = _gdk_broadway_event_source_new (display);
}
-static void
-gdk_broadway_display_init_input (GdkDisplay *display)
-{
- GdkBroadwayDisplay *broadway_display;
- GdkDeviceManager *device_manager;
- GdkDevice *device;
- GList *list, *l;
-
- broadway_display = GDK_BROADWAY_DISPLAY (display);
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
- device_manager = gdk_display_get_device_manager (display);
-
- /* For backwards compatibility, just add
- * floating devices that are not keyboards.
- */
- list = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_FLOATING);
-
- for (l = list; l; l = l->next)
- {
- device = l->data;
-
- if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
- continue;
-
- broadway_display->input_devices = g_list_prepend (broadway_display->input_devices,
- g_object_ref (l->data));
- }
-
- g_list_free (list);
-
- /* Add the core pointer to the devices list */
- broadway_display->input_devices = g_list_prepend (broadway_display->input_devices,
- g_object_ref (GDK_BROADWAY_DEVICE_MANAGER (device_manager)->core_pointer));
- G_GNUC_END_IGNORE_DEPRECATIONS;
-}
-
GdkDisplay *
_gdk_broadway_display_open (const gchar *display_name)
{
@@ -128,7 +92,6 @@ _gdk_broadway_display_open (const gchar *display_name)
gdk_event_init (display);
- gdk_broadway_display_init_input (display);
_gdk_broadway_display_init_dnd (display);
_gdk_broadway_screen_setup (broadway_display->screens[0]);
@@ -210,8 +173,6 @@ gdk_broadway_display_dispose (GObject *object)
{
GdkBroadwayDisplay *broadway_display = GDK_BROADWAY_DISPLAY (object);
- g_list_foreach (broadway_display->input_devices, (GFunc) g_object_run_dispose, NULL);
-
_gdk_screen_close (broadway_display->screens[0]);
if (broadway_display->event_source)
@@ -235,8 +196,6 @@ gdk_broadway_display_finalize (GObject *object)
_gdk_broadway_cursor_display_finalize (GDK_DISPLAY_OBJECT(broadway_display));
- /* input GdkDevice list */
- g_list_free_full (broadway_display->input_devices, g_object_unref);
/* Free all GdkScreens */
g_object_unref (broadway_display->screens[0]);
g_free (broadway_display->screens);
@@ -297,14 +256,6 @@ gdk_broadway_display_supports_composite (GdkDisplay *display)
return FALSE;
}
-static GList *
-gdk_broadway_display_list_devices (GdkDisplay *display)
-{
- g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
-
- return GDK_BROADWAY_DISPLAY (display)->input_devices;
-}
-
static gulong
gdk_broadway_display_get_next_serial (GdkDisplay *display)
{
@@ -356,7 +307,6 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
display_class->supports_shapes = gdk_broadway_display_supports_shapes;
display_class->supports_input_shapes = gdk_broadway_display_supports_input_shapes;
display_class->supports_composite = gdk_broadway_display_supports_composite;
- display_class->list_devices = gdk_broadway_display_list_devices;
display_class->get_cursor_for_type = _gdk_broadway_display_get_cursor_for_type;
display_class->get_cursor_for_name = _gdk_broadway_display_get_cursor_for_name;
display_class->get_cursor_for_surface = _gdk_broadway_display_get_cursor_for_surface;
diff --git a/gdk/broadway/gdkdisplay-broadway.h b/gdk/broadway/gdkdisplay-broadway.h
index 401ac6fa93..fe2080ac70 100644
--- a/gdk/broadway/gdkdisplay-broadway.h
+++ b/gdk/broadway/gdkdisplay-broadway.h
@@ -50,10 +50,6 @@ struct _GdkBroadwayDisplay
/* drag and drop information */
GdkDragContext *current_dest_drag;
- /* Input device */
- /* input GdkDevice list */
- GList *input_devices;
-
/* The offscreen window that has the pointer in it (if any) */
GdkWindow *active_offscreen_window;
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index f336c0e167..88586e5f49 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -293,6 +293,8 @@ gdk_display_dispose (GObject *object)
display->queued_events = NULL;
display->queued_tail = NULL;
+ g_list_foreach (display->input_devices, (GFunc) g_object_run_dispose, NULL);
+
if (device_manager)
{
/* this is to make it drop devices which may require using the X
@@ -321,6 +323,8 @@ gdk_display_finalize (GObject *object)
g_hash_table_destroy (display->pointers_info);
g_hash_table_destroy (display->multiple_click_info);
+ g_list_free_full (display->input_devices, g_object_unref);
+
if (display->device_manager)
g_object_unref (display->device_manager);
@@ -1845,7 +1849,40 @@ gdk_display_list_devices (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
- return GDK_DISPLAY_GET_CLASS (display)->list_devices (display);
+ if (!display->input_devices)
+ {
+ GdkDeviceManager *device_manager;
+ GdkDevice *device;
+ GList *list, *l;
+
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+ device_manager = gdk_display_get_device_manager (display);
+
+ /* For backwards compatibility, just add
+ * floating devices that are not keyboards.
+ */
+ list = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_FLOATING);
+
+ for (l = list; l; l = l->next)
+ {
+ device = l->data;
+
+ if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
+ continue;
+
+ display->input_devices = g_list_prepend (display->input_devices, g_object_ref (l->data));
+ }
+
+ g_list_free (list);
+
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
+ /* Add the core pointer to the devices list */
+ device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
+ display->input_devices = g_list_prepend (display->input_devices, g_object_ref (device));
+ }
+
+ return display->input_devices;
}
static GdkAppLaunchContext *
diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h
index 6bdae091bf..1b174d54be 100644
--- a/gdk/gdkdisplayprivate.h
+++ b/gdk/gdkdisplayprivate.h
@@ -111,6 +111,7 @@ struct _GdkDisplay
GHashTable *device_grabs;
GHashTable *motion_hint_info;
GdkDeviceManager *device_manager;
+ GList *input_devices; /* Deprecated, only used to keep gdk_display_list_devices working */
GHashTable *pointers_info; /* GdkPointerWindowInfo for each device */
guint32 last_event_time; /* Last reported event time from server */
@@ -175,7 +176,6 @@ struct _GdkDisplayClass
gdouble x,
gdouble y);
- GList * (*list_devices) (GdkDisplay *display);
GdkAppLaunchContext * (*get_app_launch_context) (GdkDisplay *display);
void (*before_process_all_updates) (GdkDisplay *display);
diff --git a/gdk/quartz/gdkdisplay-quartz.c b/gdk/quartz/gdkdisplay-quartz.c
index 15b3f39222..2bea5705f9 100644
--- a/gdk/quartz/gdkdisplay-quartz.c
+++ b/gdk/quartz/gdkdisplay-quartz.c
@@ -31,8 +31,6 @@
struct _GdkQuartzDisplay
{
GdkDisplay display;
-
- GList *input_devices;
};
struct _GdkQuartzDisplayClass
@@ -58,39 +56,6 @@ _gdk_device_manager_new (GdkDisplay *display)
NULL);
}
-static void
-gdk_quartz_display_init_input (GdkDisplay *display)
-{
- GdkQuartzDisplay *display_quartz;
- GdkDeviceManager *device_manager;
- GList *list, *l;
-
- display_quartz = GDK_QUARTZ_DISPLAY (display);
- device_manager = gdk_display_get_device_manager (_gdk_display);
-
- /* For backwards compabitility, just add floating devices that are
- * not keyboards.
- */
- list = gdk_device_manager_list_devices (device_manager,
- GDK_DEVICE_TYPE_FLOATING);
- for (l = list; l; l = l->next)
- {
- GdkDevice *device = l->data;
-
- if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
- continue;
-
- display_quartz->input_devices = g_list_prepend (display_quartz->input_devices,
- g_object_ref (l->data));
- }
-
- g_list_free (list);
-
- /* Add the core pointer to the devices list */
- display_quartz->input_devices = g_list_prepend (display_quartz->input_devices,
- g_object_ref (GDK_QUARTZ_DEVICE_MANAGER_CORE (device_manager)->core_pointer));
-}
-
GdkDisplay *
_gdk_quartz_display_open (const gchar *display_name)
{
@@ -110,8 +75,6 @@ _gdk_quartz_display_open (const gchar *display_name)
_gdk_quartz_events_init ();
- gdk_quartz_display_init_input (_gdk_display);
-
#if 0
/* FIXME: Remove the #if 0 when we have these functions */
_gdk_quartz_dnd_init ();
@@ -220,14 +183,6 @@ gdk_quartz_display_supports_composite (GdkDisplay *display)
return FALSE;
}
-static GList *
-gdk_quartz_display_list_devices (GdkDisplay *display)
-{
- g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
-
- return GDK_QUARTZ_DISPLAY (display)->input_devices;
-}
-
static gulong
gdk_quartz_display_get_next_serial (GdkDisplay *display)
{
@@ -254,9 +209,6 @@ gdk_quartz_display_dispose (GObject *object)
{
GdkQuartzDisplay *display_quartz = GDK_QUARTZ_DISPLAY (object);
- g_list_foreach (display_quartz->input_devices,
- (GFunc) g_object_run_dispose, NULL);
-
G_OBJECT_CLASS (gdk_quartz_display_parent_class)->dispose (object);
}
@@ -265,8 +217,6 @@ gdk_quartz_display_finalize (GObject *object)
{
GdkQuartzDisplay *display_quartz = GDK_QUARTZ_DISPLAY (object);
- g_list_free_full (display_quartz->input_devices, g_object_unref);
-
G_OBJECT_CLASS (gdk_quartz_display_parent_class)->finalize (object);
}
@@ -296,7 +246,6 @@ gdk_quartz_display_class_init (GdkQuartzDisplayClass *class)
display_class->supports_shapes = gdk_quartz_display_supports_shapes;
display_class->supports_input_shapes = gdk_quartz_display_supports_input_shapes;
display_class->supports_composite = gdk_quartz_display_supports_composite;
- display_class->list_devices = gdk_quartz_display_list_devices;
display_class->get_cursor_for_type = _gdk_quartz_display_get_cursor_for_type;
display_class->get_cursor_for_name = _gdk_quartz_display_get_cursor_for_name;
display_class->get_cursor_for_surface = _gdk_quartz_display_get_cursor_for_surface;
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index 50043dcc17..c811f19d67 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -106,18 +106,6 @@ _gdk_wayland_display_async_roundtrip (GdkWaylandDisplay *display_wayland)
}
static void
-gdk_input_init (GdkDisplay *display)
-{
- GdkWaylandDisplay *display_wayland;
-
- display_wayland = GDK_WAYLAND_DISPLAY (display);
-
- /* Add the core pointer to the devices list */
- display_wayland->input_devices = g_list_prepend (display_wayland->input_devices,
- gdk_seat_get_pointer (gdk_display_get_default_seat (display)));
-}
-
-static void
xdg_shell_ping (void *data,
struct xdg_shell *xdg_shell,
uint32_t serial)
@@ -463,8 +451,6 @@ _gdk_wayland_display_open (const gchar *display_name)
return NULL;
}
- gdk_input_init (display);
-
display_wayland->selection = gdk_wayland_selection_new ();
g_signal_emit_by_name (display, "opened");
@@ -477,9 +463,6 @@ gdk_wayland_display_dispose (GObject *object)
{
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (object);
- g_list_foreach (display_wayland->input_devices,
- (GFunc) g_object_run_dispose, NULL);
-
_gdk_screen_close (display_wayland->screen);
if (display_wayland->event_source)
@@ -515,9 +498,6 @@ gdk_wayland_display_finalize (GObject *object)
_gdk_wayland_display_finalize_cursors (display_wayland);
- /* input GdkDevice list */
- g_list_free_full (display_wayland->input_devices, g_object_unref);
-
g_object_unref (display_wayland->screen);
g_free (display_wayland->startup_notification_id);
@@ -652,14 +632,6 @@ gdk_wayland_display_supports_composite (GdkDisplay *display)
return FALSE;
}
-static GList *
-gdk_wayland_display_list_devices (GdkDisplay *display)
-{
- g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
-
- return GDK_WAYLAND_DISPLAY (display)->input_devices;
-}
-
static void
gdk_wayland_display_before_process_all_updates (GdkDisplay *display)
{
@@ -761,7 +733,6 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class)
display_class->supports_shapes = gdk_wayland_display_supports_shapes;
display_class->supports_input_shapes = gdk_wayland_display_supports_input_shapes;
display_class->supports_composite = gdk_wayland_display_supports_composite;
- display_class->list_devices = gdk_wayland_display_list_devices;
display_class->get_app_launch_context = _gdk_wayland_display_get_app_launch_context;
display_class->get_default_cursor_size = _gdk_wayland_display_get_default_cursor_size;
display_class->get_maximal_cursor_size = _gdk_wayland_display_get_maximal_cursor_size;
diff --git a/gdk/wayland/gdkdisplay-wayland.h b/gdk/wayland/gdkdisplay-wayland.h
index bb1019648d..297150ecfc 100644
--- a/gdk/wayland/gdkdisplay-wayland.h
+++ b/gdk/wayland/gdkdisplay-wayland.h
@@ -54,9 +54,6 @@ struct _GdkWaylandDisplay
GdkDisplay parent_instance;
GdkScreen *screen;
- /* input GdkDevice list */
- GList *input_devices;
-
/* Startup notification */
gchar *startup_notification_id;
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c
index 322b009d50..25273b5b38 100644
--- a/gdk/win32/gdkdisplay-win32.c
+++ b/gdk/win32/gdkdisplay-win32.c
@@ -29,33 +29,6 @@
static int debug_indent = 0;
-static GList *
-gdk_win32_display_list_devices (GdkDisplay *display)
-{
- g_return_val_if_fail (display == gdk_display_get_default (), NULL);
-
- return GDK_WIN32_DISPLAY (display)->input_devices;
-}
-
-static void
-_gdk_input_init (GdkDisplay *display)
-{
- GdkDeviceManagerWin32 *device_manager;
- GList *devices;
-
- _gdk_input_ignore_core = FALSE;
-
- device_manager = g_object_new (GDK_TYPE_DEVICE_MANAGER_WIN32,
- "display", display,
- NULL);
- display->device_manager = GDK_DEVICE_MANAGER (device_manager);
-
- devices = g_list_copy (device_manager->wintab_devices);
- devices = g_list_prepend (devices, device_manager->core_pointer);
-
- GDK_WIN32_DISPLAY (display)->input_devices = devices;
-}
-
/**
* gdk_win32_display_set_cursor_theme:
* @display: (type GdkWin32Display): a #GdkDisplay
@@ -260,7 +233,13 @@ _gdk_win32_display_open (const gchar *display_name)
win32_display->screen = g_object_new (GDK_TYPE_WIN32_SCREEN, NULL);
_gdk_events_init ();
- _gdk_input_init (_gdk_display);
+
+ _gdk_input_ignore_core = FALSE;
+
+ _gdk_display->device_manager = g_object_new (GDK_TYPE_DEVICE_MANAGER_WIN32,
+ "display", _gdk_display,
+ NULL);
+
_gdk_dnd_init ();
/* Precalculate display name */
@@ -648,8 +627,6 @@ gdk_win32_display_finalize (GObject *object)
{
GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (object);
- g_list_free (display_win32->input_devices);
-
_gdk_win32_display_finalize_cursors (display_win32);
_gdk_win32_dnd_exit ();
@@ -717,7 +694,6 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
display_class->supports_input_shapes = gdk_win32_display_supports_input_shapes;
display_class->supports_composite = gdk_win32_display_supports_composite;
- display_class->list_devices = gdk_win32_display_list_devices;
//? display_class->get_app_launch_context = _gdk_win32_display_get_app_launch_context;
display_class->get_cursor_for_type = _gdk_win32_display_get_cursor_for_type;
display_class->get_cursor_for_name = _gdk_win32_display_get_cursor_for_name;
diff --git a/gdk/win32/gdkdisplay-win32.h b/gdk/win32/gdkdisplay-win32.h
index 8f3b48e4d2..cbd4b5d7a6 100644
--- a/gdk/win32/gdkdisplay-win32.h
+++ b/gdk/win32/gdkdisplay-win32.h
@@ -28,8 +28,6 @@ struct _GdkWin32Display
GdkScreen *screen;
- GList *input_devices;
-
Win32CursorTheme *cursor_theme;
gchar *cursor_theme_name;
int cursor_theme_size;
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 484ce40f56..6804ed2006 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1338,42 +1338,6 @@ gdk_event_init (GdkDisplay *display)
}
static void
-gdk_x11_display_init_input (GdkDisplay *display)
-{
- GdkX11Display *display_x11;
- GdkDeviceManager *device_manager;
- GdkDevice *device;
- GList *list, *l;
-
- display_x11 = GDK_X11_DISPLAY (display);
-
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
- device_manager = gdk_display_get_device_manager (display);
-
- /* For backwards compatibility, just add
- * floating devices that are not keyboards.
- */
- list = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_FLOATING);
- G_GNUC_END_IGNORE_DEPRECATIONS;
-
- for (l = list; l; l = l->next)
- {
- device = l->data;
-
- if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
- continue;
-
- display_x11->input_devices = g_list_prepend (display_x11->input_devices,
- g_object_ref (l->data));
- }
-
- g_list_free (list);
-
- display_x11->input_devices = g_list_prepend (display_x11->input_devices,
- g_object_ref (gdk_seat_get_pointer (gdk_display_get_default_seat (display))));
-}
-
-static void
set_sm_client_id (GdkDisplay *display,
const gchar *sm_client_id)
{
@@ -1639,8 +1603,6 @@ _gdk_x11_display_open (const gchar *display_name)
}
#endif
- gdk_x11_display_init_input (display);
-
_gdk_x11_screen_setup (display_x11->screen);
g_signal_emit_by_name (display, "opened");
@@ -1898,8 +1860,6 @@ gdk_x11_display_dispose (GObject *object)
{
GdkX11Display *display_x11 = GDK_X11_DISPLAY (object);
- g_list_foreach (display_x11->input_devices, (GFunc) g_object_run_dispose, NULL);
-
_gdk_screen_close (display_x11->screen);
if (display_x11->event_source)
@@ -1936,9 +1896,6 @@ gdk_x11_display_finalize (GObject *object)
/* List of event window extraction functions */
g_slist_free_full (display_x11->event_types, g_free);
- /* input GdkDevice list */
- g_list_free_full (display_x11->input_devices, g_object_unref);
-
/* input GdkWindow list */
g_list_free_full (display_x11->input_windows, g_free);
@@ -2497,14 +2454,6 @@ gdk_x11_display_supports_composite (GdkDisplay *display)
x11_display->have_xfixes;
}
-static GList *
-gdk_x11_display_list_devices (GdkDisplay *display)
-{
- g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
-
- return GDK_X11_DISPLAY (display)->input_devices;
-}
-
/**
* gdk_x11_register_standard_event_type:
* @display: (type GdkX11Display): a #GdkDisplay
@@ -2981,7 +2930,6 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class)
display_class->supports_shapes = gdk_x11_display_supports_shapes;
display_class->supports_input_shapes = gdk_x11_display_supports_input_shapes;
display_class->supports_composite = gdk_x11_display_supports_composite;
- display_class->list_devices = gdk_x11_display_list_devices;
display_class->get_app_launch_context = _gdk_x11_display_get_app_launch_context;
display_class->get_cursor_for_type = _gdk_x11_display_get_cursor_for_type;
display_class->get_cursor_for_name = _gdk_x11_display_get_cursor_for_name;
diff --git a/gdk/x11/gdkdisplay-x11.h b/gdk/x11/gdkdisplay-x11.h
index 9b78f61d17..004ee69ae3 100644
--- a/gdk/x11/gdkdisplay-x11.h
+++ b/gdk/x11/gdkdisplay-x11.h
@@ -97,10 +97,6 @@ struct _GdkX11Display
/* translation queue */
GQueue *translate_queue;
- /* Input device */
- /* input GdkDevice list */
- GList *input_devices;
-
/* input GdkWindow list */
GList *input_windows;