[mutter] meta-window-actor: Add error traps in meta_window_actor_set_redirected



commit bbbb0e6002914b52818aa49a9310dcb04b9b0995
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Thu Dec 15 19:44:11 2011 +0100

    meta-window-actor: Add error traps in meta_window_actor_set_redirected
    
    meta_window_actor_set_redirected makes X calls on the client window
    so it need to set error traps.

 src/compositor/meta-window-actor.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index d2dea5b..16d136f 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -1253,19 +1253,24 @@ void
 meta_window_actor_set_redirected (MetaWindowActor *self, gboolean state)
 {
   MetaWindow *metaWindow = meta_window_actor_get_meta_window (self);
+  MetaDisplay *display = meta_window_get_display (metaWindow);
 
-  Display *xdisplay = meta_display_get_xdisplay (meta_window_get_display (metaWindow));
+  Display *xdisplay = meta_display_get_xdisplay (display);
   Window  xwin = meta_window_actor_get_x_window (self);
 
   if (state)
     {
+      meta_error_trap_push (display);
       XCompositeRedirectWindow (xdisplay, xwin, CompositeRedirectManual);
+      meta_error_trap_pop (display);
       meta_window_actor_queue_create_pixmap (self);
       self->priv->unredirected = FALSE;
     }
   else
     {
+      meta_error_trap_push (display);
       XCompositeUnredirectWindow (xdisplay, xwin, CompositeRedirectManual);
+      meta_error_trap_pop (display);
       self->priv->unredirected = TRUE;
     }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]