Skip to content
Permalink
Browse files

gpm-button: replace deprecated Gdk functions

  • Loading branch information...
raveit65 committed Aug 13, 2018
1 parent c235b2a commit 8a3e0c1d84fe655a0ae2e0dbcd8164b8fb42e0a0
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/gpm-button.c
@@ -141,13 +141,15 @@ gpm_button_grab_keystring (GpmButton *button, guint64 keycode)
{
guint modmask = AnyModifier;
Display *display;
GdkDisplay *gdkdisplay;
gint ret;

/* get the current X Display */
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default());

/* don't abort on error */
gdk_error_trap_push ();
gdkdisplay = gdk_display_get_default ();
gdk_x11_display_error_trap_push (gdkdisplay);

/* grab the key if possible */
ret = XGrabKey (display, keycode, modmask,
@@ -170,8 +172,8 @@ gpm_button_grab_keystring (GpmButton *button, guint64 keycode)
}

/* we are not processing the error */
gdk_flush ();
gdk_error_trap_pop_ignored ();
gdk_display_flush (gdkdisplay);
gdk_x11_display_error_trap_pop_ignored (gdkdisplay);

egg_debug ("Grabbed modmask=%x, keycode=%li", modmask, (long int) keycode);
return TRUE;

0 comments on commit 8a3e0c1

Please sign in to comment.
You can’t perform that action at this time.