[gnome-settings-daemon/docking-stations] Ensure the laptop is the primary display in auto-configuration and xinerama



commit 4ae44725afec0ff5660d7f01d4cd848eb42d7e95
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Nov 16 13:26:25 2011 -0600

    Ensure the laptop is the primary display in auto-configuration and xinerama
    
    Consider this situation: you close the laptop's lid, so only the external display
    remains enabled.  Thus, that external display gets set as the primary output, as
    it is the leftmost one.
    
    Then you open the lid again.  The laptop's display gets turned on.  But since
    ther already *is* a primary output (the external one), it didn't get re-set to
    be the laptop - so you get a leftmost laptop, rightmost external, with the
    primary on the external, which is not what you expect.
    
    This commit makes make_xinerama_setup() force the laptop to be
    the primary display.
    
    Signed-off-by: Federico Mena Quintero <federico gnome org>

 plugins/xrandr/gsd-xrandr-manager.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/plugins/xrandr/gsd-xrandr-manager.c b/plugins/xrandr/gsd-xrandr-manager.c
index c43cb1c..15ddebe 100644
--- a/plugins/xrandr/gsd-xrandr-manager.c
+++ b/plugins/xrandr/gsd-xrandr-manager.c
@@ -1125,15 +1125,19 @@ make_xinerama_setup (GsdXrandrManager *manager, GnomeRRScreen *screen)
         for (i = 0; outputs[i] != NULL; ++i) {
                 GnomeRROutputInfo *info = outputs[i];
 
-                if (is_laptop (screen, info) && !laptop_lid_is_closed (manager))
+                if (is_laptop (screen, info) && !laptop_lid_is_closed (manager)) {
+                        gnome_rr_output_info_set_primary (info, TRUE);
                         x = turn_on_and_get_rightmost_offset (screen, info, x);
+                }
         }
 
         for (i = 0; outputs[i] != NULL; ++i) {
                 GnomeRROutputInfo *info = outputs[i];
 
-                if (gnome_rr_output_info_is_connected (info) && !is_laptop (screen, info))
+                if (gnome_rr_output_info_is_connected (info) && !is_laptop (screen, info)) {
+                        gnome_rr_output_info_set_primary (info, FALSE);
                         x = turn_on_and_get_rightmost_offset (screen, info, x);
+                }
         }
 
         if (!trim_rightmost_outputs_that_dont_fit_in_framebuffer (screen, result)) {



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