[Xfce4-commits] <xfce4-panel:master> Again allocate 1x1 requests offscreen in the systray (bug #7143 and #7057).

Nick Schermer noreply at xfce.org
Sun Jan 23 13:52:02 CET 2011


Updating branch refs/heads/master
         to db9f6f5416ada71b070e73347d839aecba925ef0 (commit)
       from 49bc149b475fc5ba6e6e7224437d7b9f0b712337 (commit)

commit db9f6f5416ada71b070e73347d839aecba925ef0
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Jan 23 13:39:11 2011 +0100

    Again allocate 1x1 requests offscreen in the systray (bug #7143 and #7057).
    
    But with 1 difference; it seems some implementations wait
    (like nm-applet) on the size-changed signal. Although this
    is a stupid trick, we can easily work around it by allocating
    a normal size offscreen; this will trigger the signal and a new
    allocation on the tray when the app completed the status icon
    setup.
    
    For dead tray icons that are still in the panel, the 1x1 hack
    will continue to work since they have no window.

 plugins/systray/systray-box.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/plugins/systray/systray-box.c b/plugins/systray/systray-box.c
index 7fb3c29..7b9380e 100644
--- a/plugins/systray/systray-box.c
+++ b/plugins/systray/systray-box.c
@@ -40,8 +40,7 @@
 #define OFFSCREEN  (-9999)
 
 /* some icon implementations request a 1x1 size for invisible icons */
-/*#define REQUISITION_IS_INVISIBLE(child_req) ((child_req).width <= 1 && (child_req).height <= 1)*/
-#define REQUISITION_IS_INVISIBLE(child_req) (FALSE)
+#define REQUISITION_IS_INVISIBLE(child_req) ((child_req).width <= 1 && (child_req).height <= 1)
 
 
 
@@ -442,9 +441,10 @@ systray_box_size_allocate (GtkWidget     *widget,
            * or the requested size looks like an invisible icons (see macro) */
           child_alloc.x = child_alloc.y = OFFSCREEN;
 
-          /* do nothing special with the requested size */
-          child_alloc.width = child_req.width;
-          child_alloc.height = child_req.height;
+          /* some implementations (hi nm-applet) start their setup on
+           * a size-changed signal, so make sure this event is triggered
+           * by allocation a normal size instead of 1x1 */
+          child_alloc.width = child_alloc.height = row_size;
         }
       else
         {



More information about the Xfce4-commits mailing list