Skip to content

Commit d5d6e8c

Browse files
author
raveit65
committed
gpm-button: replace deprecated Gdk functions
1 parent c569240 commit d5d6e8c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/gpm-button.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,15 @@ gpm_button_grab_keystring (GpmButton *button, guint64 keycode)
141141
{
142142
guint modmask = AnyModifier;
143143
Display *display;
144+
GdkDisplay *gdkdisplay;
144145
gint ret;
145146

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

149150
/* don't abort on error */
150-
gdk_error_trap_push ();
151+
gdkdisplay = gdk_display_get_default ();
152+
gdk_x11_display_error_trap_push (gdkdisplay);
151153

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

172174
/* we are not processing the error */
173-
gdk_flush ();
174-
gdk_error_trap_pop_ignored ();
175+
gdk_display_flush (gdkdisplay);
176+
gdk_x11_display_error_trap_pop_ignored (gdkdisplay);
175177

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

0 commit comments

Comments
 (0)