[Xfce4-commits] <xfce4-settings:bluesabre/display-settings> Fixed placement of displays when changing often.

Sean Davis noreply at xfce.org
Thu Sep 27 01:24:01 CEST 2012


Updating branch refs/heads/bluesabre/display-settings
         to 278529a5e2ee1869c4adc4c5c738149e26f512f9 (commit)
       from b549e24f8384d686722b512420cebce0bcd1d116 (commit)

commit 278529a5e2ee1869c4adc4c5c738149e26f512f9
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Wed Sep 26 19:23:33 2012 -0400

    Fixed placement of displays when changing often.

 dialogs/display-settings/main.c |   38 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index f7eacd9..f95671f 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -247,7 +247,7 @@ static void
 display_setting_positions_changed (GtkComboBox *combobox,
                                      GtkBuilder  *builder)
 {
-    gint value, current_display, selected_display, n;
+    gint value, current_display, selected_display, selected_x, selected_y, n;
     GObject *display_combobox;
     XfceRRMode   *modes;
     
@@ -275,6 +275,15 @@ display_setting_positions_changed (GtkComboBox *combobox,
                 {
                     /* Change active output to secondary display. */
                     xfce_randr->active_output = selected_display;
+                    
+                    /* Move the primary to where the secondary is... */
+                    selected_x = XFCE_RANDR_POS_X (xfce_randr);
+                    selected_y = XFCE_RANDR_POS_Y (xfce_randr);
+                    xfce_randr->active_output = current_display;
+                    XFCE_RANDR_POS_X (xfce_randr) = selected_x;
+                    XFCE_RANDR_POS_Y (xfce_randr) = selected_y;
+                    
+                    xfce_randr->active_output = selected_display;
                     /* Move the secondary display to the right of the primary display. */
                     XFCE_RANDR_POS_X (xfce_randr) = modes[n].width;
                     break;
@@ -293,6 +302,15 @@ display_setting_positions_changed (GtkComboBox *combobox,
                 {
                     /* Change active output to primary display. */
                     xfce_randr->active_output = current_display;
+                    
+                    /* Move the secondary to where the primary is... */
+                    selected_x = XFCE_RANDR_POS_X (xfce_randr);
+                    selected_y = XFCE_RANDR_POS_Y (xfce_randr);
+                    xfce_randr->active_output = selected_display;
+                    XFCE_RANDR_POS_X (xfce_randr) = selected_x;
+                    XFCE_RANDR_POS_Y (xfce_randr) = selected_y;
+                    
+                    xfce_randr->active_output = current_display;
                     /* Move the primary display to the right of the secondary display. */
                     XFCE_RANDR_POS_X (xfce_randr) = modes[n].width;
                     break;
@@ -309,6 +327,15 @@ display_setting_positions_changed (GtkComboBox *combobox,
                 {
                     /* Change active output to secondary display. */
                     xfce_randr->active_output = selected_display;
+                    
+                    /* Move the primary to where the secondary is... */
+                    selected_x = XFCE_RANDR_POS_X (xfce_randr);
+                    selected_y = XFCE_RANDR_POS_Y (xfce_randr);
+                    xfce_randr->active_output = current_display;
+                    XFCE_RANDR_POS_X (xfce_randr) = selected_x;
+                    XFCE_RANDR_POS_Y (xfce_randr) = selected_y;
+                    
+                    xfce_randr->active_output = selected_display;
                     /* Move the secondary display to the above the primary display. */
                     XFCE_RANDR_POS_Y (xfce_randr) = modes[n].height;
                     break;
@@ -327,6 +354,15 @@ display_setting_positions_changed (GtkComboBox *combobox,
                 {
                     /* Change active output to primary display. */
                     xfce_randr->active_output = current_display;
+                    
+                    /* Move the secondary to where the primary is... */
+                    selected_x = XFCE_RANDR_POS_X (xfce_randr);
+                    selected_y = XFCE_RANDR_POS_Y (xfce_randr);
+                    xfce_randr->active_output = selected_display;
+                    XFCE_RANDR_POS_X (xfce_randr) = selected_x;
+                    XFCE_RANDR_POS_Y (xfce_randr) = selected_y;
+                    
+                    xfce_randr->active_output = current_display;
                     /* Move the primary display to the below the secondary display. */
                     XFCE_RANDR_POS_Y (xfce_randr) = modes[n].height;
                     break;


More information about the Xfce4-commits mailing list