GNOME Bugzilla – Bug 339861
[PATCH] Layout allocation uses bad values in wnck_tasklist_size_request()
Last modified: 2007-06-19 09:55:45 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.
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.
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
I wanted to get this in 2.15.2, but I can't easily reproduce the bug. I'll look at it later.
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.
I committed a similar patch, but using the allocation save in the GtkWidget.