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 78949 - Bookmark menu items vanish when I "add bookmarks" repeatedly
Bookmark menu items vanish when I "add bookmarks" repeatedly
Status: VERIFIED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.0.x
Other Linux
: High minor
: ---
Assigned To: Michael Meeks
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2002-04-17 13:52 UTC by Anand
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtk-demo patch to demonstrate the problem. (1.61 KB, patch)
2002-06-19 11:58 UTC, Michael Meeks
none Details | Review
Patch for gtkmenu.c (7.54 KB, patch)
2002-07-06 00:06 UTC, Owen Taylor
none Details | Review
Torture test for patch (7.51 KB, text/plain)
2002-07-06 00:07 UTC, Owen Taylor
  Details
Patch (gtkmenu.c) regenerated against CVS Head. (7.36 KB, patch)
2002-07-08 07:18 UTC, Rajkumar
none Details | Review

Description Anand 2002-04-17 13:52:19 UTC
Gnome 2.0 was built on the 15h April from CVS.

Description:

I keep doing "Bookmarks" -> "Add Bookmarks" in the main nautilus window a 
couple of times (3-4 times), *in quick succession* (this is important). At 
one point, the built-in and custom bookmark items are not visible in 
the 'Bookmarks' menu. 

All the items become visible, when I place the mouse cursor on some other 
menu (say the 'Help') and then come back to the bookmarks menu.
Comment 1 Luis Villa 2002-04-18 16:28:18 UTC
Edge case but should be fixed, I guess.
Comment 2 Anand 2002-05-20 13:15:06 UTC
Louie: still seeing this problem :/

Comment 3 Damon Chaplin 2002-05-23 18:01:35 UTC
I also see this with other popup menus, like over files.
Looks like a Bonobo issue.
Comment 4 Michael Meeks 2002-05-31 05:58:03 UTC
Looks like a Gtk+ problem to me, the items are there but not visible.
Most likely gtk+ doesn't re-size the popup correctly if items are
added after it's popped up. Will isolate.
Comment 5 Michael Meeks 2002-06-17 09:47:14 UTC
Bug easy to repeat, ~certainly a Gtk+ bug.

Gtk+ seems to have some odd macro: 'MENU_NEEDS_RESIZE' (gtkmenu.c),
that sets a flag that appears not to be used; ( also set to 0 in
gtkmenushell.c ).

Either way, you can see that there are partially occluded menu items
in what used to be the vpadding at the bottom of the popup window by
giving them focus.

The problem is that we popup a menu, and continue building it's
contents - and it appears not to get re-sized correctly to reflect the
new contents.
Comment 6 Owen Taylor 2002-06-17 13:50:56 UTC
Stand-alone test case much appreciated.
Comment 7 Michael Meeks 2002-06-19 11:57:29 UTC
Hardly difficult to construct one; presumably the aforementioned cruft
needs fixing / removing as well.

Trivial gtk-demo patch attached; if you click on the menu, you will
not notice the items being added; the popup is not re-sized correctly.
If you tear off the menu you will see them (& scroll bar etc.).
Comment 8 Michael Meeks 2002-06-19 11:58:32 UTC
Created attachment 9319 [details] [review]
gtk-demo patch to demonstrate the problem.
Comment 9 Owen Taylor 2002-07-06 00:06:05 UTC
OK, looking at this this is a pretty fringe case :-). If it's
typical to pop up the menu again before the bookmark is added,
I think we need some speed work here.

Making menus resize dynamically requires some fairly major
surgery to the menu code, so is going to be a GTK+ HEAD
only change. I'm going to attach:

 a) A standalone dynamic-menu-changing torture case. (based
    on Michael's patch but considerably extentended.)
 b) A patch that implements dynamic menu resizing. (Against
    GTK+ stable; will take a small amount of adjustment for 
    GTK+ HEAD.)

If someone wants to gives the patch some testing, I would
appreciate it. I'll put it into CVS on Monday.

If we want this for GNOME 2.0.1, you'll need to attack it from
the nautilus side.
Comment 10 Owen Taylor 2002-07-06 00:06:29 UTC
Created attachment 9671 [details] [review]
Patch for gtkmenu.c
Comment 11 Owen Taylor 2002-07-06 00:07:17 UTC
Created attachment 9672 [details]
Torture test for patch
Comment 12 Rajkumar 2002-07-08 07:08:31 UTC
Owen:
I tested the above patch and it enables the dynamic resizing of menus.

It fixes the reported problem of nautilus-bookmark menu being
truncated by enabling the dynamic growth of bookmark menu.

I have regenerated this patch against latest GTK+ HEAD and am
attaching the same here.

Comment 13 Rajkumar 2002-07-08 07:18:05 UTC
Created attachment 9703 [details] [review]
Patch (gtkmenu.c) regenerated against CVS Head.
Comment 14 Michael Meeks 2002-07-08 09:59:56 UTC
One for sun-patches then, libbonoboui relies on the fact that a
container can be updated dynamically, it puts no constraint on the
user as to when they can / cannot merge / remove UI Xml descriptions,
nor is there the semantic information available to know when they have
'finished' building a menu and now it's ok to pop it up.

So - it's really not possible to work around although it's _possible_
that we might hack around the specific case that's come to light in
nautilus, it would be extremely unwise.
Comment 15 Owen Taylor 2002-08-02 22:03:36 UTC
Applied. Many thanks for the testing.

Fri Aug  2 18:00:46 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenu.c: Fix menus resizing dynamically while
        they are popped up or torn off. (#78949)
Comment 16 Anand 2002-08-28 15:58:17 UTC
Verified fixed. Closing. Thanks.