[Xfce4-commits] <xfce4-settings:bluesabre/display-settings> Set the primary output after the changes have been applied

Simon Steinbeiss noreply at xfce.org
Thu Oct 18 23:38:16 CEST 2012


Updating branch refs/heads/bluesabre/display-settings
         to 3276965d52ccd6234ae981e78a5dc4fdcccf73d3 (commit)
       from 0726b622b7e3bd4a7b22fcca11bb7ce5803e8758 (commit)

commit 3276965d52ccd6234ae981e78a5dc4fdcccf73d3
Author: Lionel Le Folgoc <lionel at lefolgoc.net>
Date:   Thu Oct 18 16:58:45 2012 +0200

    Set the primary output after the changes have been applied
    
    And set it to None if no primary output was present in xfconf.
    
    Signed-off-by: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>

 xfsettingsd/displays.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/xfsettingsd/displays.c b/xfsettingsd/displays.c
index 2212092..7a14088 100644
--- a/xfsettingsd/displays.c
+++ b/xfsettingsd/displays.c
@@ -200,6 +200,8 @@ xfce_displays_helper_list_crtcs (Display            *xdisplay,
     crtcs = g_new0 (XfceRRCrtc, resources->ncrtc);
     for (n = 0; n < resources->ncrtc; ++n)
     {
+        xfsettings_dbg (XFSD_DEBUG_DISPLAYS, "Detected CRTC %lu.", resources->crtcs[n]);
+
         crtcs[n].id = resources->crtcs[n];
         crtc_info = XRRGetCrtcInfo (xdisplay, resources, resources->crtcs[n]);
         crtcs[n].mode = crtc_info->mode;
@@ -463,6 +465,9 @@ xfce_displays_helper_channel_apply (XfceDisplaysHelper *helper,
     GPtrArray          *connected_outputs;
     GHashTable         *saved_outputs;
     XfceRROutput       *output;
+#ifdef HAS_RANDR_ONE_POINT_THREE
+    RROutput            primary = None;
+#endif
 
     gdk_error_trap_push ();
 
@@ -522,7 +527,7 @@ xfce_displays_helper_channel_apply (XfceDisplaysHelper *helper,
                         output->info->name);
             value = g_hash_table_lookup (saved_outputs, property);
             if (G_VALUE_HOLDS_BOOLEAN (value) && g_value_get_boolean (value))
-                XRRSetOutputPrimary (xdisplay, GDK_WINDOW_XID (root_window), output->id);
+                primary = output->id;
         }
 #endif
 
@@ -789,6 +794,11 @@ xfce_displays_helper_channel_apply (XfceDisplaysHelper *helper,
         }
     }
 
+#ifdef HAS_RANDR_ONE_POINT_THREE
+        if (helper->has_1_3)
+            XRRSetOutputPrimary (xdisplay, GDK_WINDOW_XID (root_window), primary);
+#endif
+
     /* release the grab, changes are done */
     gdk_x11_display_ungrab (display);
 


More information about the Xfce4-commits mailing list