[Xfce4-commits] <xfce4-settings:master> Fix display mirroring

Sean Davis noreply at xfce.org
Sat Jan 25 20:10:04 CET 2014


Updating branch refs/heads/master
         to 14f6f4320815330bd8ed1095d80e8dd1fc12a61f (commit)
       from 18af539c96d36b5464901b12f528768478b898fd (commit)

commit 14f6f4320815330bd8ed1095d80e8dd1fc12a61f
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Wed Dec 11 10:43:00 2013 +0000

    Fix display mirroring
    
    Signed-off-by: Sean Davis <smd.seandavis at gmail.com>

 dialogs/display-settings/main.c |   30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index b48c9e9..0789517 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -1632,8 +1632,8 @@ display_settings_minimal_mirror_displays_toggled (GtkToggleButton *button,
                                                   GtkBuilder      *builder)
 {
     GObject *buttons;
-
-    guint n;
+    guint    n;
+    RRMode   mode;
 
     if (!gtk_toggle_button_get_active(button))
         return;
@@ -1646,23 +1646,23 @@ display_settings_minimal_mirror_displays_toggled (GtkToggleButton *button,
 
     buttons = gtk_builder_get_object (builder, "buttons");
     gtk_widget_set_sensitive (GTK_WIDGET(buttons), FALSE);
-
-    /* Activate all inactive displays */
+    
+    /* Activate mirror-mode with a single mode for all of them */
+    mode = xfce_randr_clonable_mode (xfce_randr);
+    /* Configure each available display for mirroring */
     for (n = 0; n < xfce_randr->noutput; ++n)
     {
         if (xfce_randr->mode[n] == None)
-        {
-            xfce_randr->mode[n] = xfce_randr_preferred_mode (xfce_randr, n);
-        }
-    }
-
-    /* Save changes to primary display */
-    xfce_randr_save_output (xfce_randr, "Default", display_channel, 0, FALSE);
+            continue;
 
-    /* Save changes to secondary display */
-    xfce_randr->relation[1] = XFCE_RANDR_PLACEMENT_MIRROR;
-    xfce_randr->related_to[1] = 0;
-    xfce_randr_save_output (xfce_randr, "Default", display_channel, 1, TRUE);
+        if (mode != None)
+            xfce_randr->mode[n] = mode;
+        xfce_randr->relation[n] = XFCE_RANDR_PLACEMENT_MIRROR;
+        xfce_randr->related_to[n] = 0;
+        xfce_randr->rotation[n] = RR_Rotate_0;
+        xfce_randr_save_output (xfce_randr, "Default", display_channel,
+                                n, TRUE);
+    }
 
     /* Apply all changes */
     xfce_randr_apply (xfce_randr, "Default", display_channel);


More information about the Xfce4-commits mailing list