After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 339861 - [PATCH] Layout allocation uses bad values in wnck_tasklist_size_request()
[PATCH] Layout allocation uses bad values in wnck_tasklist_size_request()
Status: RESOLVED FIXED
Product: libwnck
Classification: Core
Component: tasklist
2.12.x
Other Linux
: Normal normal
: ---
Assigned To: libwnck maintainers
libwnck maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-26 22:02 UTC by Joe Shaw
Modified: 2007-06-19 09:55 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
Patch which fixes this. (1.97 KB, patch)
2006-04-26 22:03 UTC, Joe Shaw
none Details | Review

Description Joe Shaw 2006-04-26 22:02:52 UTC
In wnck_tasklist_size_request(), a fake GtkAllocation is created and passed into wnck_tasklist_layout(), which in turn returns the number of rows and columns needed to optimally lay out the tasklist buttons.  The returned number of columns is used to generate panel applet "size hints", which ultimately determine how much space the applet is allocated in the panel's panel_widget_size_allocate().

The problem is that the fake GtkAllocation uses some default values: a width of 50 and a height of 48.  If you have a size 24 panel, the number of columns is half what it should be (because it was laid out according to the passed in value of 48) and the window hints end up being half the size they should be.  This causes the applet to take less space than is optimal and can result in premature grouping of windows[1] if you have "group windows when space is limited" set.

In the end it correctly only renders one row, because the size calculations are done again with the actual GtkAllocation passed in wnck_tasklist_size_allocate().

This patch stores the last width and height from wnck_tasklist_size_allocate() and uses them to calculate the layout in wnck_tasklist_size_request(), which fixes this problem.

[1] The test case for this is to have an empty desktop and a size 24 panel, open a gnome-terminal and then open 2 or 3 gaim windows (buddy list and chat window, for example).  The gaim windows will group even though there is much more room for the tasklist to grow.
Comment 1 Joe Shaw 2006-04-26 22:03:57 UTC
Created attachment 64358 [details] [review]
Patch which fixes this.

One thing I forgot to mention: this patch is against 2.12.2, since that's what we're shipping in SUSE, but the bug is still present in 2.14 and HEAD, so it should apply to both of those.
Comment 2 Rob 2006-05-03 17:59:41 UTC
I can confirm this on Ubuntu Dapper, with gnome-panel 2.14.1 and the same test case. Opening an additional window (ie firefox) fixes the problem - see screenshot s.
3 gaim windows with one terminal, behaving badly - http://www.sendspace.com/file/sv7af8 
3 gaim windows, one terminal and a firefox window, behaving as expected - http://www.sendspace.com/file/r3uv1e
Comment 3 Vincent Untz 2006-05-15 17:42:35 UTC
I wanted to get this in 2.15.2, but I can't easily reproduce the bug. I'll look at it later.
Comment 4 padraig.obriain 2007-01-30 15:09:28 UTC
My test case is yse Screen Resolution 1600x1200 and set my Window List Preferences to Group windows when space is limited.

I create two terminal windows. The Terminal windows are grouped in the window list. Now right click on the panel and click on Add to Panel. The Add to panel window is added to the panel and the terminal windows are now ungrouped.

When I tried the patch attached to this bug, when I just have the two terminal windows they are not now grouped so this patch fixes my test case.
Comment 5 Vincent Untz 2007-06-19 09:55:45 UTC
I committed a similar patch, but using the allocation save in the GtkWidget.