[gnome-flashback] monitor-config-migration: discard if configured mode is missing



commit eeda8d44f3cbb8837aaff729ce16e3004a4f24da
Author: Jonas Ådahl <jadahl gmail com>
Date:   Mon Sep 25 17:57:18 2017 -0400

    monitor-config-migration: discard if configured mode is missing
    
    If a configuration key matched a current system state, but no monitor
    mode was found (for example because of an incorrect refresh rate),
    discard it while logging a warning.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787668

 backends/gf-monitor-config-migration.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/backends/gf-monitor-config-migration.c b/backends/gf-monitor-config-migration.c
index e262060..aec5305 100644
--- a/backends/gf-monitor-config-migration.c
+++ b/backends/gf-monitor-config-migration.c
@@ -1258,6 +1258,14 @@ gf_finish_monitors_config_migration (GfMonitorManager  *monitor_manager,
       monitor = gf_monitor_manager_get_monitor_from_spec (monitor_manager, monitor_spec);
       monitor_mode_spec = monitor_config->mode_spec;
       monitor_mode = gf_monitor_get_mode_from_spec (monitor, monitor_mode_spec);
+
+      if (!monitor_mode)
+        {
+          g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+                       "Mode not available on monitor");
+          return FALSE;
+        }
+
       scale = gf_monitor_calculate_mode_scale (monitor, monitor_mode);
 
       logical_monitor_config->scale = scale;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]