Skip to content

Commit

Permalink
keyboard-manager: replace deprecated gdk_error_trap_push/pop
Browse files Browse the repository at this point in the history
  • Loading branch information
raveit65 committed Aug 22, 2018
1 parent 68df93b commit d68a31d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions plugins/keyboard/msd-keyboard-manager.c
Expand Up @@ -242,6 +242,7 @@ apply_settings (GSettings *settings,
int bell_pitch; int bell_pitch;
int bell_duration; int bell_duration;
char *volume_string; char *volume_string;
GdkDisplay *display;
#ifdef HAVE_X11_EXTENSIONS_XKB_H #ifdef HAVE_X11_EXTENSIONS_XKB_H
gboolean rnumlock; gboolean rnumlock;
#endif /* HAVE_X11_EXTENSIONS_XKB_H */ #endif /* HAVE_X11_EXTENSIONS_XKB_H */
Expand All @@ -258,11 +259,12 @@ apply_settings (GSettings *settings,
bell_volume = (volume_string && !strcmp (volume_string, "on")) ? 50 : 0; bell_volume = (volume_string && !strcmp (volume_string, "on")) ? 50 : 0;
g_free (volume_string); g_free (volume_string);


gdk_error_trap_push (); display = gdk_display_get_default ();
gdk_x11_display_error_trap_push (display);
if (repeat) { if (repeat) {
gboolean rate_set = FALSE; gboolean rate_set = FALSE;


XAutoRepeatOn (GDK_DISPLAY_XDISPLAY(gdk_display_get_default())); XAutoRepeatOn (GDK_DISPLAY_XDISPLAY (display));
/* Use XKB in preference */ /* Use XKB in preference */
#ifdef HAVE_X11_EXTENSIONS_XKB_H #ifdef HAVE_X11_EXTENSIONS_XKB_H
rate_set = xkb_set_keyboard_autorepeat_rate (delay, rate); rate_set = xkb_set_keyboard_autorepeat_rate (delay, rate);
Expand All @@ -275,7 +277,7 @@ apply_settings (GSettings *settings,
g_warning ("Neither XKeyboard not Xfree86's keyboard extensions are available,\n" g_warning ("Neither XKeyboard not Xfree86's keyboard extensions are available,\n"
"no way to support keyboard autorepeat rate settings"); "no way to support keyboard autorepeat rate settings");
} else { } else {
XAutoRepeatOff (GDK_DISPLAY_XDISPLAY(gdk_display_get_default())); XAutoRepeatOff (GDK_DISPLAY_XDISPLAY (display));
} }


/* as percentage from 0..100 inclusive */ /* as percentage from 0..100 inclusive */
Expand All @@ -302,8 +304,8 @@ apply_settings (GSettings *settings,
} }
#endif /* HAVE_X11_EXTENSIONS_XKB_H */ #endif /* HAVE_X11_EXTENSIONS_XKB_H */


XSync (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), FALSE); XSync (GDK_DISPLAY_XDISPLAY (display), FALSE);
gdk_error_trap_pop_ignored (); gdk_x11_display_error_trap_pop_ignored (display);
} }


void void
Expand Down

0 comments on commit d68a31d

Please sign in to comment.