[gnome-settings-daemon] keyboard: deprecation warning fix
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] keyboard: deprecation warning fix
- Date: Thu, 25 Nov 2021 10:36:58 +0000 (UTC)
commit 95380d78c79c49cd92b36cc5b995e8a7c23ae716
Author: Nishal Kulkarni <nishalkulkarni gmail com>
Date: Sat Sep 11 16:19:12 2021 +0530
keyboard: deprecation warning fix
`gdk_display_get_device_manager` is now deprecated,
Use GdkSeat instead of GdkDeviceManager for connecting to
device added and removed signals.
Using `gdk_display_get_default_seat` instead of
`gdk_display_get_display_manager`
plugins/keyboard/gsd-keyboard-manager.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/plugins/keyboard/gsd-keyboard-manager.c b/plugins/keyboard/gsd-keyboard-manager.c
index cb4ea98b..6e2465bc 100644
--- a/plugins/keyboard/gsd-keyboard-manager.c
+++ b/plugins/keyboard/gsd-keyboard-manager.c
@@ -85,7 +85,7 @@ struct _GsdKeyboardManager
GDBusProxy *localed;
GCancellable *cancellable;
- GdkDeviceManager *device_manager;
+ GdkSeat *user_seat;
guint device_added_id;
guint device_removed_id;
};
@@ -219,7 +219,7 @@ settings_changed (GSettings *settings,
}
static void
-device_added_cb (GdkDeviceManager *device_manager,
+device_added_cb (GdkSeat *user_seat,
GdkDevice *device,
GsdKeyboardManager *manager)
{
@@ -232,7 +232,7 @@ device_added_cb (GdkDeviceManager *device_manager,
}
static void
-device_removed_cb (GdkDeviceManager *device_manager,
+device_removed_cb (GdkSeat *user_seat,
GdkDevice *device,
GsdKeyboardManager *manager)
{
@@ -246,18 +246,18 @@ device_removed_cb (GdkDeviceManager *device_manager,
static void
set_devicepresence_handler (GsdKeyboardManager *manager)
{
- GdkDeviceManager *device_manager;
+ GdkSeat *user_seat;
if (gnome_settings_is_wayland ())
return;
- device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
+ user_seat = gdk_display_get_default_seat (gdk_display_get_default ());
- manager->device_added_id = g_signal_connect (G_OBJECT (device_manager), "device-added",
- G_CALLBACK (device_added_cb), manager);
- manager->device_removed_id = g_signal_connect (G_OBJECT (device_manager), "device-removed",
- G_CALLBACK (device_removed_cb), manager);
- manager->device_manager = device_manager;
+ manager->device_added_id = g_signal_connect (G_OBJECT (user_seat), "device-added",
+ G_CALLBACK (device_added_cb), manager);
+ manager->device_removed_id = g_signal_connect (G_OBJECT (user_seat), "device-removed",
+ G_CALLBACK (device_removed_cb), manager);
+ manager->user_seat = user_seat;
}
static gboolean
@@ -648,10 +648,10 @@ gsd_keyboard_manager_stop (GsdKeyboardManager *manager)
g_clear_object (&manager->a11y_settings);
g_clear_object (&manager->localed);
- if (manager->device_manager != NULL) {
- g_signal_handler_disconnect (manager->device_manager, manager->device_added_id);
- g_signal_handler_disconnect (manager->device_manager, manager->device_removed_id);
- manager->device_manager = NULL;
+ if (manager->user_seat != NULL) {
+ g_signal_handler_disconnect (manager->user_seat, manager->device_added_id);
+ g_signal_handler_disconnect (manager->user_seat, manager->device_removed_id);
+ manager->user_seat = NULL;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]