[mutter/wip/halfline/black-stage-before-dpms-off: 1/2] wip! stage: add new api for making the stage not paint children
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/halfline/black-stage-before-dpms-off: 1/2] wip! stage: add new api for making the stage not paint children
- Date: Sat, 17 Oct 2015 19:05:55 +0000 (UTC)
commit 87b11cc409503cddd24042704266a234e9c6534a
Author: Ray Strode <rstrode redhat com>
Date: Sat Oct 17 15:00:44 2015 -0400
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.
src/backends/meta-stage.c | 17 +++++++++++++++++
src/backends/meta-stage.h | 2 ++
2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/meta-stage.c b/src/backends/meta-stage.c
index eb270f1..edd9df7 100644
--- a/src/backends/meta-stage.c
+++ b/src/backends/meta-stage.c
@@ -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));
+ }
+}
diff --git a/src/backends/meta-stage.h b/src/backends/meta-stage.h
index 262d68f..ddc4676 100644
--- a/src/backends/meta-stage.h
+++ b/src/backends/meta-stage.h
@@ -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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]