GNOME Bugzilla – Bug 133428
wnck-applet crashed when I clicked on the Window Selector applet in an empty workspace
Last modified: 2011-02-04 16:16:03 UTC
If you switch to an empty workspace and use the Window Selector applet to switch to an existing window (in another workspace), "wnck-applet" will crash (and with it the Window Selector applet and the workspace switcher applet and the window list applet). If there are already windows in the workspace, there is no crash. This is with the CVS version of libwnck and gnome-panel 2.5.4.
I'm getting this as well.
+ Trace 44254
menu = (GtkMenu *) 0x8e398b8 menu_shell = (GtkMenuShell *) 0x8e398b8 child = (GtkWidget *) 0xbfed0544 child_allocation = {x = -1074985660, y = 147240392, width = -1074986264, height = 3934053} child_requisition = {width = 0, height = 63} priv = (GtkMenuPrivate *) 0x8e36df8 children = (GList *) 0x8c6b4f0 x = 2 y = 149133496 width = 1 height = 148449656 vertical_padding = 1 (gdb) p priv->columns $3 = 0 (gdb) p *priv $14 = {have_position = 1, x = 1132, y = 23, rows = 3, columns = 0, heights = 0x8e36ca8, heights_length = 3, monitor_num = 0} Sounds like a Gtk+ bug.
Ok, I think it is indeed a bug in Gtk+. The attached patch to Gtk+ HEAD fixes this issue for me. The problem is the last operation on the menu is a remove, and because it was the first menu item which is being removed, the number of columns is never recalculated (i.e. the else part is never reached). Hope this helps.
Created attachment 24469 [details] [review] gtkmenu.c patch
Federico, can you look at the problem and the patch, please?
I don't think that patch can fix the problem. priv->columns should already be set in set_child_property. The simplest fix is probably to change priv->columns = 0; to priv->columns = 1; before the loop, ie let menus always have at least one column, even if they're empty. The alternative would be to check for 0 before the division in line 2166.
Well, the patch *does* fix the problem :-) But setting the columns to 1 instead of 0 is indeed a better solution, I agree.
*** Bug 134451 has been marked as a duplicate of this bug. ***