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.
This commit is contained in:
Adel Gadllah 2011-12-15 19:44:11 +01:00 committed by Owen W. Taylor
parent 974be1035e
commit 12a5e1c02b

View File

@ -1252,19 +1252,24 @@ void
meta_window_actor_set_redirected (MetaWindowActor *self, gboolean state) meta_window_actor_set_redirected (MetaWindowActor *self, gboolean state)
{ {
MetaWindow *metaWindow = meta_window_actor_get_meta_window (self); 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); Window xwin = meta_window_actor_get_x_window (self);
if (state) if (state)
{ {
meta_error_trap_push (display);
XCompositeRedirectWindow (xdisplay, xwin, CompositeRedirectManual); XCompositeRedirectWindow (xdisplay, xwin, CompositeRedirectManual);
meta_error_trap_pop (display);
meta_window_actor_queue_create_pixmap (self); meta_window_actor_queue_create_pixmap (self);
self->priv->unredirected = FALSE; self->priv->unredirected = FALSE;
} }
else else
{ {
meta_error_trap_push (display);
XCompositeUnredirectWindow (xdisplay, xwin, CompositeRedirectManual); XCompositeUnredirectWindow (xdisplay, xwin, CompositeRedirectManual);
meta_error_trap_pop (display);
self->priv->unredirected = TRUE; self->priv->unredirected = TRUE;
} }
} }