[mutter/gnome-3-0] Make _NET_WM_WINDOW_OPACITY orthogonal to window actor opacity
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gnome-3-0] Make _NET_WM_WINDOW_OPACITY orthogonal to window actor opacity
- Date: Wed, 25 May 2011 18:50:53 +0000 (UTC)
commit cbec96a62f0af223c7ed0fc9d3b0eb82754899a2
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Tue Apr 26 12:08:15 2011 -0400
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 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 1d8127a..3be0363 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]