shaped-texture: Remove the use of MetaWindowActor internals

I want to make this class an independent helper.
This commit is contained in:
Jasper St. Pierre 2014-08-26 14:50:16 -04:00
parent 9063e4568c
commit a6fcda69ac

View File

@ -28,16 +28,14 @@
#include <config.h> #include <config.h>
#include <meta/meta-shaped-texture.h> #include <meta/meta-shaped-texture.h>
#include <meta/util.h> #include "meta-shaped-texture-private.h"
#include <cogl/cogl.h>
#include <gdk/gdk.h> /* for gdk_rectangle_intersect() */
#include "clutter-utils.h" #include "clutter-utils.h"
#include "meta-texture-tower.h" #include "meta-texture-tower.h"
#include "meta-shaped-texture-private.h"
#include "meta-window-actor-private.h"
#include <clutter/clutter.h>
#include <cogl/cogl.h>
#include <gdk/gdk.h> /* for gdk_rectangle_intersect() */
#include "meta-cullable.h" #include "meta-cullable.h"
static void meta_shaped_texture_dispose (GObject *object); static void meta_shaped_texture_dispose (GObject *object);
@ -536,16 +534,17 @@ static cairo_region_t *
effective_unobscured_region (MetaShapedTexture *self) effective_unobscured_region (MetaShapedTexture *self)
{ {
MetaShapedTexturePrivate *priv = self->priv; MetaShapedTexturePrivate *priv = self->priv;
ClutterActor *parent = clutter_actor_get_parent (CLUTTER_ACTOR (self)); ClutterActor *actor;
if (clutter_actor_has_mapped_clones (CLUTTER_ACTOR (self))) /* Fail if we have any mapped clones. */
return NULL; actor = CLUTTER_ACTOR (self);
do
while (parent && !META_IS_WINDOW_ACTOR (parent)) {
parent = clutter_actor_get_parent (parent); if (clutter_actor_has_mapped_clones (actor))
return NULL;
if (parent && clutter_actor_has_mapped_clones (parent)) actor = clutter_actor_get_parent (actor);
return NULL; }
while (actor != NULL);
return priv->unobscured_region; return priv->unobscured_region;
} }