Skip to content

Commit

Permalink
gs-grab-x11: 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 ba96676 commit deb9266
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/gs-grab-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ xorg_lock_smasher_set_active (GSGrab *grab,
gboolean active)
{
int status, event, error;
GdkDisplay *display;

display = gdk_display_get_default ();

if (!XF86MiscQueryExtension (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &event, &error))
if (!XF86MiscQueryExtension (GDK_DISPLAY_XDISPLAY (display), &event, &error))
{
gs_debug ("No XFree86-Misc extension present");
return;
Expand All @@ -117,12 +120,12 @@ xorg_lock_smasher_set_active (GSGrab *grab,
gs_debug ("Disabling the x.org grab smasher");
}

gdk_error_trap_push ();
gdk_x11_display_error_trap_push (display);

status = XF86MiscSetGrabKeysState (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), active);
status = XF86MiscSetGrabKeysState (GDK_DISPLAY_XDISPLAY (display), active);

gdk_display_sync (gdk_display_get_default ());
error = gdk_error_trap_pop ();
gdk_display_sync (display);
error = gdk_x11_display_error_trap_pop (display);

if (active && status == MiscExtGrabStateAlready)
{
Expand Down

0 comments on commit deb9266

Please sign in to comment.