Build Identifier: Mozilla/5.0 (X11; Linux i686; rv:2.0b8pre) Gecko/20101209 Firefox/4.0b8pre ID:20101209030340 See http://forums.mozillazine.org/viewtopic.php?p=10205813#p10205813 When I drag start a bookmark in any Bookmarks popup, the Bookmarks popup closes immediately. And This does not happen Windows build. Reproducible: Always Steps to Reproduce: 1. Start Minefield with new profile 2. drag start a bookmark in any Bookmarks popup(Bookmarks in Menubar, Bookmarks toolbar, Chevron, Firefox Button) 3. Actual Results: When I drag start a bookmark in any Bookmarks popup, the Bookmarks popup closes immediately. And leaves that bookmark visible. Expected Results: Bookmarks popup should not hide. Regression window: Works: http://hg.mozilla.org/mozilla-central/rev/f38ef1080bfe Mozilla/5.0 (X11; Linux i686; rv:2.0b7pre) Gecko/20100916 Firefox/4.0b7pre ID:20100916030125 Fails: http://hg.mozilla.org/mozilla-central/rev/268ef4ccb5ff Mozilla/5.0 (X11; Linux i686; rv:2.0b7pre) Gecko/20100917 Firefox/4.0b7pre ID:20100917034123 Pushlog: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=f38ef1080bfe&tochange=268ef4ccb5ff In local build: Build from 4097291a632c : Fails 5a68532076bf : Works Regressd by 4097291a632c Neil Deakin — Bug 522956 - Clicking Larry's "More Information" button opens Page Info dialog but doesn't close Larry. r=karlt a=b
Looks like a focus-out event occurs when a drag begins, causing the popup to rollup.
Karl, do you know why this might happen?
Versions of GTK prior to 2.18 (somewhere around Oct 2009) grabbed the keyboard during a drag. Grabbing the keyboard moves focus. http://git.gnome.org/browse/gtk+/commit/?h=gtk-2-18&id=c981ddf92ff234321d4fb9f51e58698dba507c3d At the X11 protocol level Focus events due to grabs are distinguishable from normal focus events, however GDK does not provide this distinction. http://tronche.com/gui/x/xlib/events/input-focus/grab.html With more recent GTK (2.20.1 here), the behaviour I see is that the menu closes when the pointer leaves the menu. If that is the expected behavior (and it seems reasonable to me), then we may wish to reconsider the importance of this bug.
As for a fix, possibly OnContainerFocusOutEvent could skip check_for_rollup if a drag is in progress. I haven't really thought through possible issues from async events, and whether or not rollup should be performed on drag completion.
The bookmarks code handles closing the popup itself. It closes the popup manually when dragging outside of it and any descendants. It doesn't expect the popup to close automatically while dragging.
After talking with Marco a bit, I realized that description wasn't quite correct. The ideal behaviour is that the popup closes when dragging outside of it. But special cases may need to occur when a submenu is involved. For example, dragging from a submenu to a parent menu should close the submenu but keep the parent open. Similarly, dragging to a submenu should keep both open. I will try a patch that implements comment 4.
Created attachment 497324 [details] [diff] [review] Patch
Comment on attachment 497324 [details] [diff] [review] Patch I think we still want to check_for_rollup if the focus changes during a drag started in another application (Another application may begin a drag without taking focus), and it is easy enough to check for same-application drag with nsIDragSession::GetSourceNode (or you may know a better way), so I think it's best that we do that.
Created attachment 499124 [details] [diff] [review] Updated patch