Panel plugins have a fixed size in trunk
mmassonnet at gmail.com
mmassonnet at gmail.com
Tue Oct 2 23:54:46 CEST 2007
On Mon, Sep 10, 2007 at 02:16:47PM +0200, Nick Schermer wrote:
> >From now on the plugin size is fixed in trunk. This means the plugin
> cannot increase the panel size anymore and will be cutoff when it is
> I know some developers are not going to like this, but really, you
> have to live with it. The reason is easy: some plugins use the panel
> size to, for example, calculate the icon size. If an other plugin
> increases the real size of the panel, this technique becomes useless.
> Using the allocated size might result in loops (ask Samuel ^_^), so
> this is the best solution for (almost) everyone.
Well, annoying sure, but now we have a one-way to do it. It just lacks
documentation, where this mail might help.
I figured the annoyance with the fsguard plugin. I added some features
to fsguard which I will commit this week, and maybe I'll go ahead to fix
other plugins like the systemload...
A common plugin bug will be the next: if you move the plugin to a panel
which has a different orientation or you change the orientation of the
current panel, then the plugin will be boxed inside a square (or the
The correction is simple, set a size request of (-1, -1) to the
XfcePanelPlugin in the “size-changed” callback like that:
panel_plugin_set_size (XfcePanelPlugin *panel_plugin,
/* A button */
gtk_widget_set_size_request (user_data->button, size, size);
/* A progress bar */
GtkOrientation orientation =
if (orientation == GTK_ORIENTATION_HORIZONTAL)
BORDER, -1); /* Usually BORDER is defined to 8 */
/* The panel plugin */
gtk_widget_set_size_request (GTK_WIDGET (panel_plugin), -1, -1);
Also, the fsguard plugin didn't use the XfceHVBox widget, which is
really convenient (avoids you to reparent each of your widgets)... many
other plugins might not use it.
An example for the “orientation-changed” callback:
panel_plugin_set_orientation (XfcePanelPlugin *panel_plugin,
xfce_hvbox_set_orientation (XFCE_HVBOX (user_data->box), orientation);
orientation == GTK_ORIENTATION_HORIZONTAL ?
GTK_PROGRESS_BOTTOM_TO_TOP : GTK_PROGRESS_LEFT_TO_RIGHT);
> Nick and Jasper
PS: the orientation-changed signal is always followed by the
PS2: if you steal the thread for another discussion, don't forget to
append [OT] in the really first place, or open a new thread.
More information about the Xfce4-dev