[Xfce4-commits] r29650 - in xfce4-settings/trunk: . dialogs/display-settings

Nick Schermer nick at xfce.org
Wed Mar 11 19:00:30 CET 2009


Author: nick
Date: 2009-03-11 18:00:30 +0000 (Wed, 11 Mar 2009)
New Revision: 29650

Modified:
   xfce4-settings/trunk/NEWS
   xfce4-settings/trunk/dialogs/display-settings/xfce-randr-legacy.c
Log:
Remove unsigned clamp macro that broke applying the display settings (bug #4966).


Modified: xfce4-settings/trunk/NEWS
===================================================================
--- xfce4-settings/trunk/NEWS	2009-03-11 17:43:11 UTC (rev 29649)
+++ xfce4-settings/trunk/NEWS	2009-03-11 18:00:30 UTC (rev 29650)
@@ -4,6 +4,8 @@
   appearance dialog (bug #4997).
 - Make sure inputproto 1.4.2 is available before enabling device
   hotplugging in the code (bug #5084).
+- Remove unsigned clamp macro that broke applying the display settings
+  (bug #4966).
 
 4.6.0
 =====

Modified: xfce4-settings/trunk/dialogs/display-settings/xfce-randr-legacy.c
===================================================================
--- xfce4-settings/trunk/dialogs/display-settings/xfce-randr-legacy.c	2009-03-11 17:43:11 UTC (rev 29649)
+++ xfce4-settings/trunk/dialogs/display-settings/xfce-randr-legacy.c	2009-03-11 18:00:30 UTC (rev 29650)
@@ -27,13 +27,8 @@
 
 #include "xfce-randr-legacy.h"
 
-/** CLAMP gives a warning with comparing unsigned values */
-#define UCLAMP(x, low, high) \
-  (((x) > (high)) ? (high) : \
-   (((low) > 0) ? (((low) < (x)) ? (low) : (x)) : 0))
 
 
-
 XfceRandrLegacy *
 xfce_randr_legacy_new (GdkDisplay  *display,
                        GError     **error)
@@ -184,7 +179,7 @@
     {
         /* find the resolution and save it as a string */
         sizes = XRRConfigSizes (legacy->config[n], &nsizes);
-        size = UCLAMP (legacy->resolution[n], 0, nsizes - 1);
+        size = MIN (legacy->resolution[n], MAX (0, nsizes - 1));
         resolution = g_strdup_printf ("%dx%d", sizes[size].width, sizes[size].height);
         g_snprintf (property, sizeof (property), "/%s/Screen_%d/Resolution", scheme, n);
         xfconf_channel_set_string (channel, property, resolution);




More information about the Xfce4-commits mailing list