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

Nick Schermer noreply at xfce.org
Sat Aug 28 23:04:12 CEST 2010


Updating branch refs/heads/master
         to ea111065925d08d17762a3677b9cc580f219c9c1 (commit)
       from 391bf3102d5036036f5266081e9e414cd7e3d08a (commit)

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