[gnome-settings-daemon] RANDR - For the XF86Display hotkey, preserve the cycle order when sanitizing the configurations



commit 27b97d2c0d5b9de5d1ecd95ffab097395d764437
Author: Federico Mena Quintero <federico novell com>
Date:   Fri Jul 17 11:24:37 2009 -0500

    RANDR - For the XF86Display hotkey, preserve the cycle order when sanitizing the configurations
    
    The cycle is this:
    
    - current configuration
    - clone setup
    - xinerama setup (extended desktop)
    - laptop-only setup
    - external monitors only
    - any saved configuration that matches the current monitors
    
    However, the sanitize() stage was removing duplicated configurations by giving preference
    to the modes closer to the end of the cycle, so the cycle became rather unpredictable.
    Now we remove duplicated configurations by giving preference to the modes closer to the
    start of the cycle.
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 plugins/xrandr/gsd-xrandr-manager.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/xrandr/gsd-xrandr-manager.c b/plugins/xrandr/gsd-xrandr-manager.c
index 43afaff..d278397 100644
--- a/plugins/xrandr/gsd-xrandr-manager.c
+++ b/plugins/xrandr/gsd-xrandr-manager.c
@@ -768,10 +768,10 @@ sanitize (GsdXrandrManager *manager, GPtrArray *array)
         /* Remove configurations that are duplicates of
          * configurations earlier in the cycle
          */
-        for (i = 1; i < array->len; ++i) {
+        for (i = 0; i < array->len; i++) {
                 int j;
 
-                for (j = 0; j < i; ++j) {
+                for (j = i + 1; j < array->len; j++) {
                         GnomeRRConfig *this = array->pdata[j];
                         GnomeRRConfig *other = array->pdata[i];
 



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