[gnome-settings-daemon] keyboard: deprecated gdk_error_trap calls fix



commit e5f62bd38b0f580b90427c46445d28450b012742
Author: Nishal Kulkarni <kulknishu gmail com>
Date:   Fri May 7 23:12:11 2021 +0530

    keyboard: deprecated gdk_error_trap calls fix
    
    Replace `gdk_error_trap_push` and `gdk_error_trap_pop_ignored` with
    `gdk_x11_display_error_trap_push ()` and
    `gdk_x11_display_error_trap_pop_ignored ()` calls.

 plugins/keyboard/gsd-keyboard-manager.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/plugins/keyboard/gsd-keyboard-manager.c b/plugins/keyboard/gsd-keyboard-manager.c
index 2feb87ef..cb4ea98b 100644
--- a/plugins/keyboard/gsd-keyboard-manager.c
+++ b/plugins/keyboard/gsd-keyboard-manager.c
@@ -146,6 +146,7 @@ schema_is_installed (const char *schema)
 static void
 apply_bell (GsdKeyboardManager *manager)
 {
+        GdkDisplay      *gdisplay;
        GSettings       *settings;
         XKeyboardControl kbdcontrol;
         gboolean         click;
@@ -158,6 +159,8 @@ apply_bell (GsdKeyboardManager *manager)
         if (gnome_settings_is_wayland ())
                 return;
 
+        gdisplay = gdk_display_get_default ();
+
         g_debug ("Applying the bell settings");
         settings      = manager->settings;
         click         = g_settings_get_boolean  (settings, KEY_CLICK);
@@ -180,13 +183,13 @@ apply_bell (GsdKeyboardManager *manager)
         kbdcontrol.bell_pitch = bell_pitch;
         kbdcontrol.bell_duration = bell_duration;
 
-        gdk_error_trap_push ();
+        gdk_x11_display_error_trap_push (gdisplay);
         XChangeKeyboardControl (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
                                 KBKeyClickPercent | KBBellPercent | KBBellPitch | KBBellDuration,
                                 &kbdcontrol);
 
         XSync (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), FALSE);
-        gdk_error_trap_pop_ignored ();
+        gdk_x11_display_error_trap_pop_ignored (gdisplay);
 }
 
 static void


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