problem with systray icons in SVN

Arjen Stolk arjen.1729 at gmail.com
Sun Feb 26 23:04:14 CET 2006


Hello,

Just grabbed the SVN sources for the first time and pleased to say
they compiled like clockwork.

I came across a slight problem with the systray panel applet. When an
icon gets added to the area, it is really narrow (1 pixel wide). When
I resize the panel, the icons do get the right size.

I took a brief look at the code and here's what I think happens: The
icon_docked function in systray.c gets called when an icon is added.
It determines the size of the icon using:

int size = MIN (systray->iconbox->allocation.width,
systray->iconbox->allocation.height);

The iconbox's allocation.height/width is apparently really small when
the panel is hidden.
I fixed it in my source by replacing the above line with:

int size;
g_object_get(G_OBJECT(tray), "size", &size, NULL);
int border = size > 26 ? 2 : 0;
size = size - border - MAX (systray->frame->style->xthickness,
   systray->frame->style->ythickness);

This is just a copy of the code from systray_set_size, together with
two lines to actually obtain the size from the systray. This works on
my system, but I have no idea if this is the 'right' way to do this,
as I am not at all familiar with the code.

Best regards,

Arjen Stolk



More information about the Xfce4-dev mailing list