[mutter/wip/halfline/black-stage-before-dpms-off: 2/2] xrandr: set stage to black before dpms off
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/halfline/black-stage-before-dpms-off: 2/2] xrandr: set stage to black before dpms off
- Date: Sat, 17 Oct 2015 19:02:57 +0000 (UTC)
commit a001e4d5d5ecd5395dbcf31b521f95e2a268776a
Author: Ray Strode <rstrode redhat com>
Date: Sat Oct 17 15:01:17 2015 -0400
xrandr: set stage to black before dpms off
redraws aren't processed when dpms has been turned
off, so we need to set the stage to black before
the screen goes dark, so that when it comes back
it's not showing stale contents.
src/backends/x11/meta-monitor-manager-xrandr.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c
index 9008841..3c114cf 100644
--- a/src/backends/x11/meta-monitor-manager-xrandr.c
+++ b/src/backends/x11/meta-monitor-manager-xrandr.c
@@ -43,6 +43,8 @@
#include <meta/errors.h>
#include "meta-monitor-config.h"
+#include "meta-stage.h"
+
#define ALL_TRANSFORMS ((1 << (META_MONITOR_TRANSFORM_FLIPPED_270 + 1)) - 1)
/* Look for DPI_FALLBACK in:
@@ -647,6 +649,23 @@ get_xmode_name (XRRModeInfo *xmode)
}
static void
+update_stage_visibility_for_power_save_mode (MetaMonitorManager *manager)
+{
+ MetaBackend *backend = meta_get_backend ();
+ ClutterActor *stage = meta_backend_get_stage (backend);
+
+ if ((manager->power_save_mode != META_POWER_SAVE_ON) &&
+ (manager->power_save_mode != META_POWER_SAVE_UNSUPPORTED))
+ {
+ meta_stage_set_black (META_STAGE (stage), TRUE);
+ }
+ else
+ {
+ meta_stage_set_black (META_STAGE (stage), FALSE);
+ }
+}
+
+static void
meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
{
MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (manager);
@@ -693,6 +712,8 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
manager->power_save_mode = META_POWER_SAVE_UNSUPPORTED;
}
+ update_stage_visibility_for_power_save_mode (manager);
+
XRRGetScreenSizeRange (manager_xrandr->xdisplay, DefaultRootWindow (manager_xrandr->xdisplay),
&min_width,
&min_height,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]