diff options
author | Armin Krezović <krezovic.armin@gmail.com> | 2017-08-26 18:27:50 +0200 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2018-07-06 19:47:16 +0200 |
commit | dacc041d0c0ddefa99085158dcbdeb13949b3cd0 (patch) | |
tree | 5b9148300ad52cd164a8879cfa4bc77186c7980d /src/core/errors.c | |
parent | 18779109deb3d0fe89fc4aa0ca80002c24f71b81 (diff) | |
download | mutter-dacc041d0c0ddefa99085158dcbdeb13949b3cd0.tar.gz |
Switch meta_error_trap functions to MetaX11Display
They are X11 specific functions, used for X11 code. They have been
improved per jadahl's suggestion to use gdk_x11_lookup_xdisplay and
gdk_x11_display_error_trap_* functions, instead of current code.
https://bugzilla.gnome.org/show_bug.cgi?id=759538
Diffstat (limited to 'src/core/errors.c')
-rw-r--r-- | src/core/errors.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/src/core/errors.c b/src/core/errors.c index 0b3e5cc54..61085607e 100644 --- a/src/core/errors.c +++ b/src/core/errors.c @@ -26,10 +26,10 @@ #include <config.h> #include <meta/errors.h> -#include "display-private.h" #include <errno.h> #include <stdlib.h> -#include <gdk/gdk.h> +#include <gdk/gdkx.h> +#include "x11/meta-x11-display-private.h" /* In GTK+-3.0, the error trapping code was significantly rewritten. The new code * has some neat features (like knowing automatically if a sync is needed or not @@ -44,19 +44,34 @@ */ void -meta_error_trap_push (MetaDisplay *display) +meta_error_trap_push (MetaX11Display *x11_display) { - gdk_error_trap_push (); + GdkDisplay *gdk_display; + + gdk_display = gdk_x11_lookup_xdisplay (x11_display->xdisplay); + g_assert (gdk_display != NULL); + + gdk_x11_display_error_trap_push (gdk_display); } void -meta_error_trap_pop (MetaDisplay *display) +meta_error_trap_pop (MetaX11Display *x11_display) { - gdk_error_trap_pop_ignored (); + GdkDisplay *gdk_display; + + gdk_display = gdk_x11_lookup_xdisplay (x11_display->xdisplay); + g_assert (gdk_display != NULL); + + gdk_x11_display_error_trap_pop_ignored (gdk_display); } int -meta_error_trap_pop_with_return (MetaDisplay *display) +meta_error_trap_pop_with_return (MetaX11Display *x11_display) { - return gdk_error_trap_pop (); + GdkDisplay *gdk_display; + + gdk_display = gdk_x11_lookup_xdisplay (x11_display->xdisplay); + g_assert (gdk_display != NULL); + + return gdk_x11_display_error_trap_pop (gdk_display); } |