[metacity] avoid deprecated gdk error trap functions
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] avoid deprecated gdk error trap functions
- Date: Sun, 11 Mar 2018 14:19:13 +0000 (UTC)
commit fdf2e9d33e42da09190f03bb0528d2f17c601e02
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sun Mar 11 13:33:25 2018 +0200
avoid deprecated gdk error trap functions
src/compositor/meta-compositor-xrender.c | 8 ++++----
src/core/errors.c | 28 +++++++++++++++++++++++++---
src/core/group.c | 5 +++--
src/core/screen.c | 4 ++--
4 files changed, 34 insertions(+), 11 deletions(-)
---
diff --git a/src/compositor/meta-compositor-xrender.c b/src/compositor/meta-compositor-xrender.c
index 36e986a..85ecf8d 100644
--- a/src/compositor/meta-compositor-xrender.c
+++ b/src/compositor/meta-compositor-xrender.c
@@ -1755,7 +1755,7 @@ repair_win (MetaCompositorXRender *xrender,
Display *xdisplay = meta_display_get_xdisplay (display);
XserverRegion parts;
- meta_error_trap_push (NULL);
+ meta_error_trap_push (display);
if (!cw->damaged)
{
@@ -1769,7 +1769,7 @@ repair_win (MetaCompositorXRender *xrender,
XFixesTranslateRegion (xdisplay, parts, cw->rect.x, cw->rect.y);
}
- meta_error_trap_pop (NULL);
+ meta_error_trap_pop (display);
dump_xserver_region (xrender, "repair_win", parts);
add_damage (xrender, parts);
@@ -2699,7 +2699,7 @@ meta_compositor_xrender_process_event (MetaCompositor *compositor,
* X errors. This is really a hack, but I'm afraid I don't understand
* enough about Metacity/X to know how else you are supposed to do it
*/
- meta_error_trap_push (NULL);
+ meta_error_trap_push (display);
switch (event->type)
{
@@ -2717,7 +2717,7 @@ meta_compositor_xrender_process_event (MetaCompositor *compositor,
break;
}
- meta_error_trap_pop (NULL);
+ meta_error_trap_pop (display);
}
static cairo_surface_t *
diff --git a/src/core/errors.c b/src/core/errors.c
index 213d2de..39adb93 100644
--- a/src/core/errors.c
+++ b/src/core/errors.c
@@ -21,23 +21,45 @@
#include "config.h"
#include <gdk/gdk.h>
+#include <gdk/gdkx.h>
#include "errors.h"
void
meta_error_trap_push (MetaDisplay *display)
{
- gdk_error_trap_push ();
+ Display *xdisplay;
+ GdkDisplay *gdk_display;
+
+ xdisplay = meta_display_get_xdisplay (display);
+ gdk_display = gdk_x11_lookup_xdisplay (xdisplay);
+ g_assert (gdk_display != NULL);
+
+ gdk_x11_display_error_trap_push (gdk_display);
}
void
meta_error_trap_pop (MetaDisplay *display)
{
- gdk_error_trap_pop_ignored ();
+ Display *xdisplay;
+ GdkDisplay *gdk_display;
+
+ xdisplay = meta_display_get_xdisplay (display);
+ gdk_display = gdk_x11_lookup_xdisplay (xdisplay);
+ g_assert (gdk_display != NULL);
+
+ gdk_x11_display_error_trap_pop_ignored (gdk_display);
}
int
meta_error_trap_pop_with_return (MetaDisplay *display)
{
- return gdk_error_trap_pop ();
+ Display *xdisplay;
+ GdkDisplay *gdk_display;
+
+ xdisplay = meta_display_get_xdisplay (display);
+ gdk_display = gdk_x11_lookup_xdisplay (xdisplay);
+ g_assert (gdk_display != NULL);
+
+ return gdk_x11_display_error_trap_pop (gdk_display);
}
diff --git a/src/core/group.c b/src/core/group.c
index a3f4f88..13c0b1c 100644
--- a/src/core/group.c
+++ b/src/core/group.c
@@ -22,6 +22,7 @@
#include <config.h>
#include "util.h"
+#include "errors.h"
#include "group-private.h"
#include "group-props.h"
#include "window.h"
@@ -45,13 +46,13 @@ meta_group_new (MetaDisplay *display,
group->group_leader = group_leader;
group->refcount = 1; /* owned by caller, hash table has only weak ref */
- gdk_error_trap_push ();
+ meta_error_trap_push (display);
XGetWindowAttributes (display->xdisplay, group_leader, &attrs);
XSelectInput (display->xdisplay, group_leader,
attrs.your_event_mask | PropertyChangeMask);
- if (gdk_error_trap_pop () != 0)
+ if (meta_error_trap_pop_with_return (display) != 0)
return NULL;
if (display->groups_by_leader == NULL)
diff --git a/src/core/screen.c b/src/core/screen.c
index 52afaf9..c801f84 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -1131,12 +1131,12 @@ get_window_pixbuf (MetaWindow *window,
if (surface == NULL)
return NULL;
- meta_error_trap_push (NULL);
+ meta_error_trap_push (display);
pixbuf = meta_ui_get_pixbuf_from_surface (surface);
cairo_surface_destroy (surface);
- if (meta_error_trap_pop_with_return (NULL) != Success)
+ if (meta_error_trap_pop_with_return (display) != Success)
g_clear_object (&pixbuf);
if (pixbuf == NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]