Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 408541 - lxde-base/lxpanel-0.5.8: enabling dynamic width and autohide results in 1 pixel panel
Summary: lxde-base/lxpanel-0.5.8: enabling dynamic width and autohide results in 1 pix...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LXDE team (DEFUNCT)
URL:
Whiteboard:
Keywords: InVCS, PATCH, PMASKED, UPSTREAM
Depends on:
Blocks:
 
Reported: 2012-03-17 02:38 UTC by Jack Chen
Modified: 2012-05-25 23:18 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for lxde-base/lxpanel-0.5.8-r2 to fix the problem. (lxpanel-0.5.8-dynamic-autohide-resize.patch,1.53 KB, patch)
2012-03-17 02:38 UTC, Jack Chen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Chen 2012-03-17 02:38:39 UTC
Created attachment 305663 [details, diff]
Patch for lxde-base/lxpanel-0.5.8-r2 to fix the problem.

Problem:
When configuring lxpanel with dynamic width and autohide enabled, it will become 1-pixel-wide.
It seems like the bug was reported upstream but has not been fixed yet:
http://sourceforge.net/tracker/?func=detail&aid=3206797&group_id=180858&atid=894869


Steps to reproduce:
1. Install =lxde-base/lxpanel-0.5.8 (or any other version).
2. Start up lxpanel.
3. Open up setting dialog of main panel (right click on the panel and choose "Panel Settings").
4. At the Geometry tab, configure it to have dynamic width (the pull-down menu on the right side of the width spinbox).
5. At the Advanced tab, configure it to be auto-hiding (tick "Minimize panel when not in use").
6. Restart lxpanel.
7. The 1-pixel mini panel appears.


Actual result:
The panel will have 1 pixel width most of the time.  It resizes to normal width occasionally.


Expected result:
The panel should allocate proper minimum size, instead of resizing to 1-pixel.


How often:
Almost always reproducible.


Fix:
I've attached a workaround patch based on lxde-base/lxpanel-0.5.8-r2.  It works and resizes correctly so far.
However, I think it needs more testing.

This patch attempts to fix the following 2 problems.  I'll describe my guess as detailed as I can, so people can help me judge whether they are good solutions or not.

1. When dyanmic width and autohide are enabled, the panel got resized to 1 pixel.
My guess is that, the GTK size-request event was incorrectly used.  I'm not sure about this one, though, but what I did was adding gtk_widget_set_size_request() function call to size-request callback.  lxpanel originally tries to set the "GtkRequisition *req" argument of the size-request callback.
This fixes the fundamental problem.  The panel is no longer 1-pixel-wide when in visible state.

2. The panel in hidden state is still 1-pixel-wide.
lxpanel calls gtk_widget_hide() to hide panel contents when hiding panel.  My guess is that, the hidden container box occupies no space, which makes size-request to always report 0 pixel, causing the whole panel to become 1-pixel-wide when hidden.
The method I used to fix this problem is to ask the "content box" for panel size, instead of the container of the content box (the panel).


I'll report this possible solution to upstream later, probably by linking back here.
Comment 1 Markos Chandras (RETIRED) gentoo-dev 2012-03-17 16:31:28 UTC
Thanks for taking this bug upstream. We'll keep an eye on how upstream will handle this bug and apply the patch as appropriate
Comment 2 Markos Chandras (RETIRED) gentoo-dev 2012-05-07 10:14:40 UTC
This should be fixed in -r3 which is now masked. Please test and report back here. Thanks a lot
Comment 3 Jack Chen 2012-05-09 23:50:03 UTC
Installed lxde-base/lxpanel-0.5.8-r3 yesterday.
So far, it works fine with my configuration (one dynamic auto-hide panel as system tray).  I'll comment on this bug again if I find any critical issue.
Thank you.
Comment 4 Henry Gebhardt 2012-05-17 15:04:14 UTC
I intend to send a pull-request upstream with a slightly modified (but essentially the same) version of your patch. Please check if it is ok here:

https://github.com/hsgg/lxpanel/commit/e3e6be2ca32f7bc13e24b8e66c8667c078cb342b

Thanks.
Comment 5 Jack Chen 2012-05-23 01:45:08 UTC
(In reply to comment #4)
> I intend to send a pull-request upstream with a slightly modified (but
> essentially the same) version of your patch. Please check if it is ok here:
> 
> https://github.com/hsgg/lxpanel/commit/
> e3e6be2ca32f7bc13e24b8e66c8667c078cb342b
> 
> Thanks.

Your patch looks fine and works here.
Actually I think your patch looks tidier and therefore is the better one.
Comment 7 Markos Chandras (RETIRED) gentoo-dev 2012-05-23 17:35:24 UTC
I guess we need (yet) another revision here
Comment 8 Henry Gebhardt 2012-05-24 02:14:27 UTC
(In reply to comment #7)
> I guess we need (yet) another revision here

Nah, the patches are similar enough... But as you wish, of course...
Comment 9 Markos Chandras (RETIRED) gentoo-dev 2012-05-25 23:18:59 UTC
Ok I see no reason to create a new revision then. We can keep using the existing one until a new lxpanel is out. Thanks a lot for the patch and the testing!