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



commit 511265e57439bf46859d6af306beba4c9ec927e7
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 d4cce54..378fc6b 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -1945,7 +1945,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);
 
@@ -1958,7 +1959,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]