wip! stage: add new api for making the stage not paint children

We want to darken the stage before dpms, so this commit adds
a way to do that.

Note this probably doesn't work since we have no-clear hint set
on the stage.
This commit is contained in:
Ray Strode 2015-10-17 15:00:44 -04:00
parent 86d8c3954f
commit 87b11cc409
2 changed files with 19 additions and 0 deletions

View File

@ -41,6 +41,7 @@ typedef struct {
struct _MetaStagePrivate {
MetaOverlay cursor_overlay;
gboolean is_active;
gboolean is_black;
};
typedef struct _MetaStagePrivate MetaStagePrivate;
@ -121,6 +122,9 @@ meta_stage_paint (ClutterActor *actor)
MetaStage *stage = META_STAGE (actor);
MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
if (priv->is_black)
return;
CLUTTER_ACTOR_CLASS (meta_stage_parent_class)->paint (actor);
meta_overlay_paint (&priv->cursor_overlay);
@ -261,3 +265,16 @@ meta_stage_set_active (MetaStage *stage,
*/
clutter_stage_event (CLUTTER_STAGE (stage), &event);
}
void
meta_stage_set_black (MetaStage *stage,
gboolean is_black)
{
MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
if (priv->is_black != is_black)
{
priv->is_black = is_black;
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
}
}

View File

@ -57,6 +57,8 @@ void meta_stage_set_cursor (MetaStage *stage,
void meta_stage_set_active (MetaStage *stage,
gboolean is_active);
void meta_stage_set_black (MetaStage *stage,
gboolean is_black);
G_END_DECLS
#endif /* META_STAGE_H */