window-actor: Flip set_redirected around

I know it's confusing with the triple negative, but unredirected is how
we track it elsewhere: we have an 'unredirected' flag, and 'should_unredirect'.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
This commit is contained in:
Jasper St. Pierre 2013-12-06 17:36:09 -05:00
parent 1f6158ace7
commit 56f8d32ca9
3 changed files with 17 additions and 17 deletions

View File

@ -755,7 +755,7 @@ set_unredirected_window (MetaCompScreen *info,
if (info->unredirected_window != NULL) if (info->unredirected_window != NULL)
{ {
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (info->unredirected_window)); MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (info->unredirected_window));
meta_window_actor_set_redirected (window_actor, TRUE); meta_window_actor_set_unredirected (window_actor, FALSE);
} }
info->unredirected_window = window; info->unredirected_window = window;
@ -763,7 +763,7 @@ set_unredirected_window (MetaCompScreen *info,
if (info->unredirected_window != NULL) if (info->unredirected_window != NULL)
{ {
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (info->unredirected_window)); MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (info->unredirected_window));
meta_window_actor_set_redirected (window_actor, FALSE); meta_window_actor_set_unredirected (window_actor, TRUE);
} }
meta_shape_cow_for_window (info->screen, info->unredirected_window); meta_shape_cow_for_window (info->screen, info->unredirected_window);

View File

@ -35,13 +35,13 @@ void meta_window_actor_frame_complete (MetaWindowActor *self,
void meta_window_actor_invalidate_shadow (MetaWindowActor *self); void meta_window_actor_invalidate_shadow (MetaWindowActor *self);
void meta_window_actor_set_redirected (MetaWindowActor *self, gboolean state);
gboolean meta_window_actor_should_unredirect (MetaWindowActor *self);
void meta_window_actor_get_shape_bounds (MetaWindowActor *self, void meta_window_actor_get_shape_bounds (MetaWindowActor *self,
cairo_rectangle_int_t *bounds); cairo_rectangle_int_t *bounds);
gboolean meta_window_actor_should_unredirect (MetaWindowActor *self);
void meta_window_actor_set_unredirected (MetaWindowActor *self,
gboolean unredirected);
gboolean meta_window_actor_effect_in_progress (MetaWindowActor *self); gboolean meta_window_actor_effect_in_progress (MetaWindowActor *self);
void meta_window_actor_sync_actor_geometry (MetaWindowActor *self, void meta_window_actor_sync_actor_geometry (MetaWindowActor *self,
gboolean did_placement); gboolean did_placement);

View File

@ -1299,7 +1299,8 @@ meta_window_actor_should_unredirect (MetaWindowActor *self)
} }
void void
meta_window_actor_set_redirected (MetaWindowActor *self, gboolean state) meta_window_actor_set_unredirected (MetaWindowActor *self,
gboolean unredirected)
{ {
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); MetaDisplay *display = meta_window_get_display (metaWindow);
@ -1307,21 +1308,20 @@ meta_window_actor_set_redirected (MetaWindowActor *self, gboolean state)
Display *xdisplay = meta_display_get_xdisplay (display); Display *xdisplay = meta_display_get_xdisplay (display);
Window xwin = meta_window_get_toplevel_xwindow (metaWindow); Window xwin = meta_window_get_toplevel_xwindow (metaWindow);
if (state) meta_error_trap_push (display);
if (unredirected)
{ {
meta_error_trap_push (display); XCompositeUnredirectWindow (xdisplay, xwin, CompositeRedirectManual);
XCompositeRedirectWindow (xdisplay, xwin, CompositeRedirectManual);
meta_error_trap_pop (display);
meta_window_actor_detach (self);
self->priv->unredirected = FALSE;
} }
else else
{ {
meta_error_trap_push (display); XCompositeRedirectWindow (xdisplay, xwin, CompositeRedirectManual);
XCompositeUnredirectWindow (xdisplay, xwin, CompositeRedirectManual); meta_window_actor_detach_x11_pixmap (self);
meta_error_trap_pop (display);
self->priv->unredirected = TRUE;
} }
self->priv->unredirected = unredirected;
meta_error_trap_pop (display);
} }
void void