This commit is contained in:
Jasper St. Pierre 2014-08-21 15:04:34 -04:00
parent 074946ac0b
commit 308cccc72c
2 changed files with 22 additions and 0 deletions

View File

@ -40,6 +40,7 @@ typedef struct {
} MetaOverlay; } MetaOverlay;
struct _MetaStagePrivate { struct _MetaStagePrivate {
MetaOverlay dnd_overlay;
MetaOverlay cursor_overlay; MetaOverlay cursor_overlay;
}; };
typedef struct _MetaStagePrivate MetaStagePrivate; typedef struct _MetaStagePrivate MetaStagePrivate;
@ -112,6 +113,7 @@ meta_stage_finalize (GObject *object)
MetaStage *stage = META_STAGE (object); MetaStage *stage = META_STAGE (object);
MetaStagePrivate *priv = meta_stage_get_instance_private (stage); MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
meta_overlay_free (&priv->dnd_overlay);
meta_overlay_free (&priv->cursor_overlay); meta_overlay_free (&priv->cursor_overlay);
} }
@ -123,6 +125,7 @@ meta_stage_paint (ClutterActor *actor)
CLUTTER_ACTOR_CLASS (meta_stage_parent_class)->paint (actor); CLUTTER_ACTOR_CLASS (meta_stage_parent_class)->paint (actor);
meta_overlay_paint (&priv->dnd_overlay);
meta_overlay_paint (&priv->cursor_overlay); meta_overlay_paint (&priv->cursor_overlay);
} }
@ -142,6 +145,7 @@ meta_stage_init (MetaStage *stage)
{ {
MetaStagePrivate *priv = meta_stage_get_instance_private (stage); MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
meta_overlay_init (&priv->dnd_overlay);
meta_overlay_init (&priv->cursor_overlay); meta_overlay_init (&priv->cursor_overlay);
clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), FALSE); clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), FALSE);
@ -183,6 +187,19 @@ queue_redraw_for_overlay (MetaStage *stage,
} }
} }
void
meta_stage_set_dnd_surface (MetaStage *stage,
CoglTexture *texture,
MetaRectangle *rect)
{
MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
g_assert (meta_is_wayland_compositor ());
meta_overlay_set (&priv->dnd_overlay, texture, rect);
queue_redraw_for_overlay (stage, &priv->dnd_overlay);
}
void void
meta_stage_set_cursor (MetaStage *stage, meta_stage_set_cursor (MetaStage *stage,
CoglTexture *texture, CoglTexture *texture,

View File

@ -51,9 +51,14 @@ GType meta_stage_get_type (void) G_GNUC_CONST;
ClutterActor *meta_stage_new (void); ClutterActor *meta_stage_new (void);
void meta_stage_set_dnd_surface (MetaStage *stage,
CoglTexture *texture,
MetaRectangle *rect);
void meta_stage_set_cursor (MetaStage *stage, void meta_stage_set_cursor (MetaStage *stage,
CoglTexture *texture, CoglTexture *texture,
MetaRectangle *rect); MetaRectangle *rect);
G_END_DECLS G_END_DECLS
#endif /* META_STAGE_H */ #endif /* META_STAGE_H */