[mutter] mutter-window: Add error traps check_needs_reshape
- From: Adel Gadllah <agadllah src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] mutter-window: Add error traps check_needs_reshape
- Date: Mon, 27 Sep 2010 18:12:19 +0000 (UTC)
commit 1123fca3f285e11e2dfa966c6a74d39ad8e6dbc0
Author: Adel Gadllah <adel gadllah gmail com>
Date: Mon Sep 27 20:10:35 2010 +0200
mutter-window: Add error traps check_needs_reshape
A window might change its shape and close immediately and thus causing
XShapeGetRectangles to produce a BadWindow, use an error trap
to avoid that.
src/compositor/mutter-window.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/compositor/mutter-window.c b/src/compositor/mutter-window.c
index 299566e..012d818 100644
--- a/src/compositor/mutter-window.c
+++ b/src/compositor/mutter-window.c
@@ -1712,6 +1712,8 @@ static void
check_needs_reshape (MutterWindow *self)
{
MutterWindowPrivate *priv = self->priv;
+ MetaScreen *screen = priv->screen;
+ MetaDisplay *display = meta_screen_get_display (screen);
if (!priv->needs_reshape)
return;
@@ -1722,15 +1724,17 @@ check_needs_reshape (MutterWindow *self)
#ifdef HAVE_SHAPE
if (priv->shaped)
{
- Display *xdisplay = meta_display_get_xdisplay (meta_window_get_display (priv->window));
+ Display *xdisplay = meta_display_get_xdisplay (display);
XRectangle *rects;
int n_rects, ordering;
+ meta_error_trap_push (display);
rects = XShapeGetRectangles (xdisplay,
priv->xwindow,
ShapeBounding,
&n_rects,
&ordering);
+ meta_error_trap_pop (display, TRUE);
if (rects)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]