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

Nick Schermer noreply at xfce.org
Sun Oct 28 10:44:14 CET 2012


Updating branch refs/heads/master
         to d2a415b5314eef158e8a457c69e3b5622b15aae9 (commit)
       from 7c45c31da0a14f22dc1aec02e94361674fac68e3 (commit)

commit d2a415b5314eef158e8a457c69e3b5622b15aae9
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