[gnome-flashback] display-config: skip outputs with no modes



commit 83b9c10b75d242a81b85ba547bab0b6418093cfe
Author: Rui Matos <tiagomatos gmail com>
Date:   Tue Oct 27 15:24:58 2015 +0100

    display-config: skip outputs with no modes
    
    If we can't find any valid modes for an output we need to unwind and
    skip the output because trying to use a modeless output later will
    crash us.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756796

 .../libdisplay-config/flashback-monitor-manager.c  |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gnome-flashback/libdisplay-config/flashback-monitor-manager.c 
b/gnome-flashback/libdisplay-config/flashback-monitor-manager.c
index f8155d6..b2e12b6 100644
--- a/gnome-flashback/libdisplay-config/flashback-monitor-manager.c
+++ b/gnome-flashback/libdisplay-config/flashback-monitor-manager.c
@@ -809,6 +809,8 @@ output_get_modes (FlashbackMonitorManager *manager,
         }
     }
   meta_output->n_modes = n_actual_modes;
+  if (n_actual_modes > 0)
+    meta_output->preferred_mode = meta_output->modes[0];
 }
 
 static char *
@@ -1337,8 +1339,6 @@ read_current_config (FlashbackMonitorManager *manager)
           output_get_tile_info (priv, meta_output);
           output_get_modes (manager, meta_output, output);
 
-          meta_output->preferred_mode = meta_output->modes[0];
-
           meta_output->n_possible_crtcs = output->ncrtc;
           meta_output->possible_crtcs = g_new0 (MetaCRTC *, meta_output->n_possible_crtcs);
 
@@ -1387,7 +1387,10 @@ read_current_config (FlashbackMonitorManager *manager)
         else
           meta_output->backlight = -1;
 
-        n_actual_outputs++;
+        if (meta_output->n_modes == 0)
+          clear_output (meta_output);
+        else
+          n_actual_outputs++;
       }
 
       XRRFreeOutputInfo (output);


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