Truncated systray icons

Jasper Huijsmans jasper at xfce.org
Mon Feb 27 20:08:52 CET 2006


Jasper Huijsmans schreef:
> Olivier Fourdan schreef:
>> Hey Jasper,
>>
>> Jani Monoses wrote:
>>> Replacing MIN with MAX in systray.c should fix it.
>> I've been looking for this literally for years, and I kept searching in 
>> the systray widget implementation... While it was in the panel's systray!
>>
>> The afterward size_request on the icon introduces an obvious race 
>> condition, causing the problem with truncated icons (that last since 
>> xfce 4.0)
>>
>> The following patch removes the size request and fix the issue for me.
>>
> 
> 
> Hmm, I get a huge icon tray with orage because it sets a much to large 
> icon. I really would like to limit the size.
> 

Does this work for you? At least when you make the panel large enough 
for the icon to fit?


Index: plugins/systray/systray.c
===================================================================
--- plugins/systray/systray.c	(revision 20124)
+++ plugins/systray/systray.c	(working copy)
@@ -83,9 +83,13 @@
  {
      if (systray->tray_registered)
      {
-        int size = MIN (systray->iconbox->allocation.width,
-                        systray->iconbox->allocation.height);
+        int size = xfce_panel_plugin_get_size (systray->plugin);
+        int border = size > 26 ? 2 : 0;

+
+        size = size - border - 2 - MAX (systray->frame->style->xthickness,
+                                        systray->frame->style->ythickness);
+
          gtk_widget_hide (systray->iconbox);
          gtk_box_pack_start (GTK_BOX (systray->iconbox), icon,
                              FALSE, FALSE, 0);
@@ -172,8 +176,8 @@

      gtk_container_set_border_width (GTK_CONTAINER (systray->frame), 
border);

-    size = size - border - MAX (systray->frame->style->xthickness,
-                                systray->frame->style->ythickness);
+    size = size - border - 2 - MAX (systray->frame->style->xthickness,
+                                    systray->frame->style->ythickness);

      list = gtk_container_get_children (GTK_CONTAINER (systray->iconbox));
      for (l = list; l != NULL; l = l->next)





More information about the Xfce4-dev mailing list