mirror of
https://github.com/brl/mutter.git
synced 2025-08-05 16:14:51 +00:00
stage: Add overlay for the DnD surface
This will be rendered similarly to the pointer cursor.
This commit is contained in:

committed by
Carlos Garnacho

parent
92b7daab61
commit
dfde1ff327
@@ -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,
|
||||||
|
@@ -51,6 +51,10 @@ 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);
|
||||||
|
Reference in New Issue
Block a user