[Xfce4-commits] r25713 - in xfce4-panel/branches/xfce_4_4: . panel

Jasper Huijsmans jasper at xfce.org
Tue May 15 20:01:37 CEST 2007


Author: jasper
Date: 2007-05-15 18:01:37 +0000 (Tue, 15 May 2007)
New Revision: 25713

Removed:
   xfce4-panel/branches/xfce_4_4/INSTALL
Modified:
   xfce4-panel/branches/xfce_4_4/configure.ac.in
   xfce4-panel/branches/xfce_4_4/panel/panel-properties.c
Log:
Fix check for valid stut value to also work with differently sized monitors.

Deleted: xfce4-panel/branches/xfce_4_4/INSTALL

Modified: xfce4-panel/branches/xfce_4_4/configure.ac.in
===================================================================
--- xfce4-panel/branches/xfce_4_4/configure.ac.in	2007-05-15 18:01:30 UTC (rev 25712)
+++ xfce4-panel/branches/xfce_4_4/configure.ac.in	2007-05-15 18:01:37 UTC (rev 25713)
@@ -11,7 +11,7 @@
 dnl panel version info
 m4_define([xfce4_panel_version_major], [4])
 m4_define([xfce4_panel_version_minor], [4])
-m4_define([xfce4_panel_version_micro], [1])
+m4_define([xfce4_panel_version_micro], [2])
 m4_define([xfce4_panel_version_nano],  [])   dnl leave this empty to have no nano version
 m4_define([xfce4_panel_version_build], [@REVISION@])
 m4_define([xfce4_panel_version_tag],   [])

Modified: xfce4-panel/branches/xfce_4_4/panel/panel-properties.c
===================================================================
--- xfce4-panel/branches/xfce_4_4/panel/panel-properties.c	2007-05-15 18:01:30 UTC (rev 25712)
+++ xfce4-panel/branches/xfce_4_4/panel/panel-properties.c	2007-05-15 18:01:37 UTC (rev 25713)
@@ -242,6 +242,14 @@
                                        top, bottom, left, right);
 }
 
+/* fairly arbitrary maximum strut size */
+static gboolean
+_validate_strut( gint width,
+                 gint offset )
+{
+    return ( offset < width / 4 );
+}
+
 static void
 _set_struts (Panel       *panel, 
              XfceMonitor *xmon, 
@@ -279,7 +287,8 @@
             /* no struts possible on Xinerama screens when this monitor
              * has neighbors on the left (see fd.o spec).
              */
-            if (!xmon->has_neighbor_left)
+            if (!xmon->has_neighbor_left 
+                && _validate_strut (xmon->geometry.width, w))
             {
                 data[0] = xmon->geometry.x 
                           + w;          /* left           */
@@ -292,7 +301,8 @@
             /* no struts possible on Xinerama screens when this monitor
              * has neighbors on the right (see fd.o spec).
              */
-            if (!xmon->has_neighbor_right)
+            if (!xmon->has_neighbor_right 
+                && _validate_strut (xmon->geometry.width, w))
             {
                 data[1] =  gdk_screen_get_width (xmon->screen) 
                            - xmon->geometry.x - xmon->geometry.width 
@@ -306,7 +316,8 @@
             /* no struts possible on Xinerama screens when this monitor
              * has neighbors on the top (see fd.o spec).
              */
-            if (!xmon->has_neighbor_above)
+            if (!xmon->has_neighbor_above 
+                && _validate_strut (xmon->geometry.height, h))
             {
                 data[2] = xmon->geometry.y 
                           + h;          /* top            */
@@ -319,7 +330,8 @@
             /* no struts possible on Xinerama screens when this monitor
              * has neighbors on the bottom (see fd.o spec).
              */
-            if (!xmon->has_neighbor_below)
+            if (!xmon->has_neighbor_below
+                && _validate_strut (xmon->geometry.height, h))
             {
                 data[3] = gdk_screen_get_height (xmon->screen) 
                            - xmon->geometry.y - xmon->geometry.height 
@@ -338,15 +350,6 @@
          data[4], data[5], data[6], data[7], 
          data[8], data[9], data[10], data[11]);
 
-    /* Check for invalid values. */
-    for (i = 0; i < 4; i++)
-    {
-        if (data[i] > MIN(xmon->geometry.width,xmon->geometry.height) / 4)
-        {
-            return;
-        }
-    }
-    
     /* Check if values have changed. */
     for (i = 0; i < 12; i++)
     {
@@ -360,17 +363,17 @@
     if (update)
     {
         gdk_error_trap_push ();
-
         gdk_property_change (GTK_WIDGET (panel)->window,
                              gdk_atom_intern ("_NET_WM_STRUT_PARTIAL", FALSE),
                              gdk_atom_intern ("CARDINAL", FALSE), 32,
                              GDK_PROP_MODE_REPLACE, (guchar *) & data, 12);
+        gdk_error_trap_pop ();
 
+        gdk_error_trap_push ();
         gdk_property_change (GTK_WIDGET (panel)->window,
                              gdk_atom_intern ("_NET_WM_STRUT", FALSE),
                              gdk_atom_intern ("CARDINAL", FALSE), 32,
                              GDK_PROP_MODE_REPLACE, (guchar *) & data, 4);
-
         gdk_error_trap_pop ();
     }
     



More information about the Xfce4-commits mailing list