Last Comment Bug 500081 - Can't start dragging a menu toolbarbutton with type menu after the popup has been opened
: Can't start dragging a menu toolbarbutton with type menu after the popup has ...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Widget: Gtk (show other bugs)
: Trunk
: All Linux
: -- normal (vote)
: mozilla13
Assigned To: Karl Tomlinson (back Dec 13 :karlt)
:
:
Mentors:
: 724688 (view as bug list)
Depends on: 787943 724966 724967 725685 736811 750061
Blocks: 495675 725047
  Show dependency treegraph
 
Reported: 2009-06-23 16:46 PDT by Marco Bonardo [::mak]
Modified: 2012-10-28 21:34 PDT (History)
11 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
remove unused GdkWindow parameter to check_for_rollup (4.71 KB, patch)
2012-02-01 16:07 PST, Karl Tomlinson (back Dec 13 :karlt)
roc: review+
Details | Diff | Splinter Review
part 2: don't keep trying pointer grab when failing due to another application's grab (1.40 KB, patch)
2012-02-01 16:17 PST, Karl Tomlinson (back Dec 13 :karlt)
roc: review+
Details | Diff | Splinter Review
privatize and devirtualize a few nsWindow methods (1.94 KB, patch)
2012-02-01 17:04 PST, Karl Tomlinson (back Dec 13 :karlt)
roc: review+
Details | Diff | Splinter Review
part 4: use a timestamp when grabbing the pointer and generate timestamps for drags in the same way (10.07 KB, patch)
2012-02-01 17:15 PST, Karl Tomlinson (back Dec 13 :karlt)
roc: review+
Details | Diff | Splinter Review

Description Marco Bonardo [::mak] 2009-06-23 16:46:50 PDT
On Bookmarks toolbar we support dragging toolbarbuttons with type "menu", but we have to workaround a dragging issue on Linux.
Popups are opened on mousedown, on this platform as soon as the popup opens we're unable to start a drag operation, while this is not a problem on Win or Mac.

So we have delay the menu.open = true on mousedown, and decide based on gesture if the user wants to drag (in such a case we stop opening) or to open (in such a case we prevent the drag). Previously we were forcing all users to hold down SHIFT to allow a drag, due to this issue (indeed i thought this bug was already filed, but can't find it atm).
If Linux would work as other platforms, we could simply let the popup open, and see later if we want to drag.
Comment 1 Ian Nartowicz 2012-01-27 06:56:01 PST
The current delay before opening the popup is probably too short.  I actually found this bug while searching for one about why I couldn't drag a bookmarks folder on Linux.  With much effort I can now manage to initiate a drag about 1 time in 10.  The timer seems to be 300ms but there certainly doesn't seem to be that much time to start the drag.  Perhaps it takes a good fraction of that time for Firefox to register that a drag is starting, leaving very little window?
Comment 2 Karl Tomlinson (back Dec 13 :karlt) 2012-01-31 20:37:25 PST
Can the popup be closed before initiating the drag?
Comment 3 Karl Tomlinson (back Dec 13 :karlt) 2012-02-01 16:05:06 PST
The drag fails because it is using a timestamp that is older than the time of the pointer grab on the menu.  The pointer grab for the menu should use the timestamp from the event that opens the menu, but it uses the current time.
Comment 4 Karl Tomlinson (back Dec 13 :karlt) 2012-02-01 16:07:22 PST
Created attachment 593638 [details] [diff] [review]
remove unused GdkWindow parameter to check_for_rollup

Some cleanup before I add another caller.
Comment 5 Karl Tomlinson (back Dec 13 :karlt) 2012-02-01 16:17:22 PST
Created attachment 593642 [details] [diff] [review]
part 2: don't keep trying pointer grab when failing due to another application's grab

In a subsequent patch I'll add a timestamp to the grab, which will (rightly) increase the likelihood of failure if there have been other events between the event that caused the grab request (button down for menu option) and the actual grab request(s).

This patch ensures that we do the right thing when the grab fails.  The retry code is to deal with popups that are initially zero size.  Zero-sized windows are not viewable and so the grab can't be performed until the window is resized.
Comment 6 Karl Tomlinson (back Dec 13 :karlt) 2012-02-01 17:04:50 PST
Created attachment 593661 [details] [diff] [review]
privatize and devirtualize a few nsWindow methods

Noting that the grab methods here are private clarifies the scope for review, and I noticed that the neighbouring "Native" methods were still virtual from the old CommonWidget base class.
Comment 7 Karl Tomlinson (back Dec 13 :karlt) 2012-02-01 17:15:33 PST
Created attachment 593664 [details] [diff] [review]
part 4: use a timestamp when grabbing the pointer and generate timestamps for drags in the same way
Comment 9 Alice0775 White 2012-02-06 21:41:49 PST
*** Bug 724688 has been marked as a duplicate of this bug. ***
Comment 11 Chris Coulson 2012-06-13 14:23:53 PDT
This ended up exposing a nasty little bug in Unity :)

https://launchpad.net/bugs/1010466

Note You need to log in before you can comment on or make changes to this bug.