From 711dd044448c29a93798edeced1faf0aff7a864e Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sat, 17 Oct 2015 15:01:17 -0400 Subject: [PATCH] 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. --- .../x11/meta-monitor-manager-xrandr.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c index 900884170..3c114cf71 100644 --- a/src/backends/x11/meta-monitor-manager-xrandr.c +++ b/src/backends/x11/meta-monitor-manager-xrandr.c @@ -43,6 +43,8 @@ #include #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: @@ -646,6 +648,23 @@ get_xmode_name (XRRModeInfo *xmode) return g_strdup_printf ("%dx%d", width, height); } +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) { @@ -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,