[gnome-control-center/gnome-3-14] display: In clone mode, set geometry of all outputs when one changes



commit 69089a09196cd6c9d37763579e80de2e88cd957c
Author: Rui Matos <tiagomatos gmail com>
Date:   Thu Feb 19 18:06:27 2015 +0100

    display: In clone mode, set geometry of all outputs when one changes
    
    Otherwise we could fail to validate the new configuration depending on
    which output we're initializing mirror mode from.
    
    gnome_rr_config_applicable() creates a temporary array of outputs for
    validation and, in clone mode, all of them are assigned the same
    geometry but, since it lacks context about which output the user is
    currently on, it just uses the first one's geometry for all of
    them. If this first output isn't the one the user is changing in the
    UI then we never called _set_geometry() on it with a clone mode
    geometry and thus the validation would fail because the geometry used
    is that output's current mode which might not match the clone mode's.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=743816

 panels/display/cc-display-panel.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index ee12793..63b3c39 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -1904,7 +1904,8 @@ res_combo_changed (GtkComboBox    *combo,
   GtkTreeModel *res_model;
   GtkTreeIter iter;
   GnomeRRMode *mode;
-  gint x, y, width, height;
+  gint x, y, width, height, i;
+  GnomeRROutputInfo **outputs;
 
   res_model = gtk_combo_box_get_model (combo);
 
@@ -1917,7 +1918,17 @@ res_combo_changed (GtkComboBox    *combo,
       width = gnome_rr_mode_get_width (mode);
       height = gnome_rr_mode_get_height (mode);
 
-      gnome_rr_output_info_set_geometry (priv->current_output, x, y, width, height);
+      if (gnome_rr_config_get_clone (priv->current_configuration))
+        {
+          outputs = gnome_rr_config_get_outputs (priv->current_configuration);
+          for (i = 0; outputs[i]; i++)
+            gnome_rr_output_info_set_geometry (outputs[i], x, y, width, height);
+        }
+      else
+        {
+          gnome_rr_output_info_set_geometry (priv->current_output, x, y, width, height);
+        }
+
       update_apply_button (panel);
     }
 }


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