xfce4 updates

Olivier Fourdan fourdan at xfce.org
Sun Oct 27 23:42:22 CET 2002


Hi Japser, 

> Could you try now? I tried to fix it.

Okay, what you did is not the proper way of doing things IMHO. Firstly,
mapping the window and hiding it just afterwards looks tricky. Secondly,
the window manager will prevent you from mapping the window off screen,
so it shows on screen which doesn't look very good.

Here attached you'll find a patch that is, for me, a much better way of
computing the size allocation. That one works for me.

> I changed the desktop switcher a bit to show separators in modern style,
> instead of the frame:
> http://members.home.nl/jbhuijsmans/20021027.png

Yope, I love that :)

Cheers,
-- 
Olivier               <fourdan at xfce.org>            http://www.xfce.org
-----------------------------------------------------------------------
XFce is a lightweight  desktop  environment  for  various *NIX systems. 
Designed for productivity,  it loads  and  executes  applications fast,
while conserving  system resources. XFce is all free software, released
under GNU General Public License.    Available from http://www.xfce.org
-------------- next part --------------
--- xfce4.orig/panel/callbacks.c	Sun Oct 27 23:38:05 2002
+++ xfce4/panel/callbacks.c	Sun Oct 27 23:36:05 2002
@@ -104,7 +104,8 @@
     int w, h;
     gboolean vertical = settings.orientation == VERTICAL;
     int pos = settings.popup_position;
-    GtkAllocation alloc;
+    GtkAllocation alloc = { 0, };
+    GtkAllocation tmp_allocation = { 0, };
 
     if(open_popup)
         hide_popup(open_popup);
@@ -141,11 +142,14 @@
     if(!GTK_WIDGET_REALIZED(pp->window))
         gtk_widget_realize(pp->window);
 
-    /* show the window off scren to get the right dimensions */
-    gtk_window_move(GTK_WINDOW(pp->window), w+1, h+1);
-    gtk_widget_show(pp->window);
     gtk_widget_size_request(pp->window, &req2);
-    gtk_widget_hide(pp->window);
+
+    tmp_allocation.width = req2.width;
+    tmp_allocation.height = req2.height;
+
+    gtk_widget_size_allocate (pp->window, &tmp_allocation);
+    
+    gtk_widget_realize (GTK_WIDGET (pp->window));
 
     /*  positioning logic (well ...)
      *  ----------------------------


More information about the Xfce4-dev mailing list