From cbec96a62f0af223c7ed0fc9d3b0eb82754899a2 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 26 Apr 2011 12:08:15 -0400 Subject: [PATCH] Make _NET_WM_WINDOW_OPACITY orthogonal to window actor opacity Using MetaWindowActor.opacity for _NET_WM_WINDOW_OPACITY makes it difficult to implement effects like fading a window in on map. Instead, set the opacity on the MetaShadedTexture child and use it when drawing the shadow. Since the check MetaWindowGroup does on meta_actor_get_paint_opacity() no longer covers this, we need to handle the opacity in meta_window_actor_get_obscured_region() explicitly. https://bugzilla.gnome.org/show_bug.cgi?id=648613 --- src/compositor/meta-window-actor.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c index 1d8127a1d..3be036320 100644 --- a/src/compositor/meta-window-actor.c +++ b/src/compositor/meta-window-actor.c @@ -411,8 +411,6 @@ meta_window_actor_constructed (GObject *object) if (format && format->type == PictTypeDirect && format->direct.alphaMask) priv->argb32 = TRUE; - meta_window_actor_update_opacity (self); - if (!priv->actor) { priv->actor = meta_shaped_texture_new (); @@ -442,7 +440,7 @@ meta_window_actor_constructed (GObject *object) clutter_actor_raise_top (priv->actor); } - + meta_window_actor_update_opacity (self); meta_window_actor_update_shape (self, priv->shaped); } @@ -725,7 +723,7 @@ meta_window_actor_paint (ClutterActor *actor) params.y_offset + shape_bounds.y, shape_bounds.width, shape_bounds.height, - (clutter_actor_get_paint_opacity (actor) * params.opacity) / 255, + (clutter_actor_get_paint_opacity (actor) * params.opacity * priv->opacity) / (255 * 255), priv->shadow_clip); } @@ -1690,7 +1688,7 @@ meta_window_actor_get_obscured_region (MetaWindowActor *self) { MetaWindowActorPrivate *priv = self->priv; - if (!priv->argb32 && priv->back_pixmap) + if (!priv->argb32 && priv->opacity == 0xff && priv->back_pixmap) { if (priv->shaped) return priv->shape_region; @@ -2147,5 +2145,5 @@ meta_window_actor_update_opacity (MetaWindowActor *self) opacity = 255; self->priv->opacity = opacity; - clutter_actor_set_opacity (CLUTTER_ACTOR (self), opacity); + clutter_actor_set_opacity (self->priv->actor, opacity); }