[Xfce4-commits] <xfce4-settings:xrandr-display-settings> Reconfigure an output/a screen only when it's really needed

Jérôme Guelfucci noreply at xfce.org
Sat Jun 12 09:58:09 CEST 2010


Updating branch refs/heads/xrandr-display-settings
         to 33ae22339844a1ec3fdffe76db2b9140efad9aa6 (commit)
       from 0688bf31194298e975b794176d155dca85e85cb7 (commit)

commit 33ae22339844a1ec3fdffe76db2b9140efad9aa6
Author: Lionel Le Folgoc <mrpouit at gmail.com>
Date:   Fri Jun 11 22:01:52 2010 +0200

    Reconfigure an output/a screen only when it's really needed

 xfce4-settings-helper/displays.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xfce4-settings-helper/displays.c b/xfce4-settings-helper/displays.c
index 66a7f04..4a2ce19 100644
--- a/xfce4-settings-helper/displays.c
+++ b/xfce4-settings-helper/displays.c
@@ -480,7 +480,8 @@ xfce_displays_helper_channel_apply (XfceDisplaysHelper *helper,
                                                               &width, &height, &mm_width, &mm_height);
 
                 /* check if we really need to do something */
-                if (crtc_info->mode != mode || crtc_info->rotation != rot)
+                if (crtc_info->mode != mode || crtc_info->rotation != rot
+                    || crtc_info->x != pos_x || crtc_info->y != pos_y)
                 {
                     if (XRRSetCrtcConfig (xdisplay, resources, crtc, crtc_info->timestamp,
                                           pos_x, pos_y, mode, rot, outputs, noutput) != RRSetConfigSuccess)
@@ -505,8 +506,14 @@ xfce_displays_helper_channel_apply (XfceDisplaysHelper *helper,
     }
 
     /* everything has been applied, set the screen size */
+    n = gdk_x11_get_default_screen ();
+    /* call it only if it's really needed and valid */
     if (width >= min_width && width <= max_width
-        && height >= min_height && height <= max_height)
+        && height >= min_height && height <= max_height
+        && (width != DisplayWidth (xdisplay, n)
+            || height != DisplayHeight (xdisplay, n)
+            || mm_width != DisplayWidthMM (xdisplay, n)
+            || mm_height != DisplayHeightMM (xdisplay, n)))
         XRRSetScreenSize (xdisplay, GDK_WINDOW_XID (root_window),
                           width, height, mm_width, mm_height);
 



More information about the Xfce4-commits mailing list