[Xfce4-commits] <xfce4-settings:ochosi/primary> Set all connected displays to secondary when the active one is set to primary

Simon Steinbeiss noreply at xfce.org
Fri Dec 7 17:10:01 CET 2012


Updating branch refs/heads/ochosi/primary
         to fd388c938d047aa17301f4de69c649b058f4796c (commit)
       from 7379317c553beb34e2b1a61027c1e7ad0afa3487 (commit)

commit fd388c938d047aa17301f4de69c649b058f4796c
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Fri Dec 7 17:07:26 2012 +0100

    Set all connected displays to secondary when the active one is set to primary

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

diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index 8646acb..7ed4761 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -1211,11 +1211,23 @@ static void
 display_setting_primary_toggled (GtkToggleButton *togglebutton,
                                 GtkBuilder      *builder)
 {
+    guint   m;
+    
     if (!xfce_randr)
         return;
 
     if (gtk_toggle_button_get_active (togglebutton))
+    {
+    /* Set currently active display as primary and all others as secondary */
         xfce_randr->status[active_output]=XFCE_OUTPUT_STATUS_PRIMARY;
+        for (m = 0; m < xfce_randr->noutput; ++m)
+        {
+            if (m != active_output)
+            {
+                xfce_randr->status[m]=XFCE_OUTPUT_STATUS_SECONDARY;
+            }
+        }
+    }
     else
         xfce_randr->status[active_output]=XFCE_OUTPUT_STATUS_SECONDARY;
 


More information about the Xfce4-commits mailing list