[Xfce4-commits] <xfce4-panel:andrzejr/deskbar2> panel-itembar: Removed item size checks.

Andrzej noreply at xfce.org
Wed Jan 25 11:54:01 CET 2012


Updating branch refs/heads/andrzejr/deskbar2
         to f36269287e32cab3239a07f44b9be00ba8bd11f1 (commit)
       from 5dce65fb615c76d73ec3f8a4da882852efb7645c (commit)

commit f36269287e32cab3239a07f44b9be00ba8bd11f1
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Wed Jan 25 14:35:21 2012 +0900

    panel-itembar: Removed item size checks.
    
    Problem:
    
    get_requisition on external plugins returns an old size_request
    value when the size of the panel is changed quickly (e.g. when
    user controls the "size" slider using cursor keys).
    
    In case of "small" external plugins this means that they are
    "losing" their "small" status when the user quickly decreases
    the panel size. This is because their get_requisition size
    is temporarily larger than the row size. This in turn causes
    a lot of flicker when the user changes (decreases) the panel size.
    
    (the above was tested using an xfce4-mixer plugin with a patch from:
    https://bugzilla.xfce.org/show_bug.cgi?id=8350 )
    
    Arguably, the itembar doesn't have to check the plugin size, only
    the "small" flag. It's then the plugins responsibility to render itself
    in such a way it fits in a single row.
    
    The itembar is still using the plugin size to decide the row height.
    It may temporarily be incorrect when the panel size changes quickly
    but that doesn't cause flicker.

 panel/panel-itembar.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/panel/panel-itembar.c b/panel/panel-itembar.c
index 2f3564c..bda6c01 100644
--- a/panel/panel-itembar.c
+++ b/panel/panel-itembar.c
@@ -339,8 +339,7 @@ panel_itembar_size_request (GtkWidget      *widget,
 
           /* check if the small child fits in a row */
           if (child->option == CHILD_OPTION_SMALL
-              && itembar->nrows > 1
-              && CHILD_FITS_IN_ROW (child_req, itembar))
+              && itembar->nrows > 1)
             {
               child_len = CHILD_LENGTH (child_req, itembar);
 
@@ -453,8 +452,7 @@ panel_itembar_size_allocate (GtkWidget     *widget,
           child_len = CHILD_LENGTH (child_req, itembar);
 
           if (G_UNLIKELY (child->option == CHILD_OPTION_SMALL
-              && itembar->nrows > 1
-              && CHILD_FITS_IN_ROW (child_req, itembar)))
+                          && itembar->nrows > 1))
             {
               /* extract from the available space */
               if (child_len > row_max_size)
@@ -586,8 +584,7 @@ panel_itembar_size_allocate (GtkWidget     *widget,
         child_len = 1;
 
       if (child->option == CHILD_OPTION_SMALL
-          && itembar->nrows > 1
-          && CHILD_FITS_IN_ROW (child_req, itembar))
+          && itembar->nrows > 1)
         {
           if (row_max_size < child_len)
             row_max_size = child_len;


More information about the Xfce4-commits mailing list