Closed Bug 899530 Opened 12 years ago Closed 11 years ago

The bookmarks menu from the widget closes too fast for drag&drop

Categories

(Firefox :: Bookmarks & History, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 30
Tracking Status
firefox29 + verified
firefox30 --- verified

People

(Reporter: mak, Assigned: Gijs)

References

(Blocks 1 open bug)

Details

(Keywords: regression, Whiteboard: [Australis:P2])

Attachments

(2 files, 1 obsolete file)

dragging a link to the widget opens the panel, but it closes too fast when dragging the link towards the menu, it should allow more time to complete the action.
Whiteboard: [Australis:M?][Australis:P?]
Whiteboard: [Australis:M?][Australis:P?] → [Australis:M?][Australis:P5]
Whiteboard: [Australis:M?][Australis:P5] → [Australis:M?][Australis:P3]
I poked at this, and it seems that the panel appearing causes the problem; several dragleave events fire because the mouse is over items in the panel or the panel arrow, and then for some reason another dragleave event fires with the navbar customize target as its relatedTarget, so even detecting these things in the panel as 'safe' doesn't really help. :-( This is likely to do with the other and various bugs on file about how clicking the menu sometimes activates the first item in the panel instead of just showing the panel, as well as the panel moving after having been shown (even if I can't see that on my machine, it's clearly happening if there are mouseleave events targeted at it without my having moved my mouse)
Blocks: 941051
Whiteboard: [Australis:M?][Australis:P3] → [Australis:P2]
It's now *possible* to drag items into the menu, but on my first few attempts the menu still flickered and disappeared, so this isn't fixed yet...
So I poked at this today, and even if I fix PlacesMenuDNDHandler's dragenter to cancel any dragleaves for the same node, the bookmarks popup actually closes *without* the timer (set up by dragleave) having been called (the timer's callback console.logs stuff, so I'm sure it doesn't get called). That ends up meaning: I don't know what's actually closing the menu. :-\
(In reply to Marco Bonardo [:mak] from comment #5) > may this be involved? > http://mxr.mozilla.org/mozilla-central/source/browser/components/places/ > content/menu.xml#240 Looks plausible. I'll have to have another look tomorrow.
Flags: needinfo?(mak77)
Err, totally meant to needinfo myself here.
Flags: needinfo?(mak77) → needinfo?(gijskruitbosch+bugs)
This fixes the issue for me. Both close menu helpers needed some adjusting, but this seems only slightly ugly, and seems to work pretty well. Note that I added a guard inside the function I added on the PlacesControllerDragHelper because I'm not sure that always lives in a browser window and can assume that the relevant API exists. It might be unnecessary.
Attachment #8370865 - Flags: review?(mak77)
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Flags: needinfo?(gijskruitbosch+bugs)
Comment on attachment 8370865 [details] [diff] [review] adjust bookmarks drag code to not close the menu when over the menu button, Review of attachment 8370865 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/base/content/browser-places.js @@ +740,5 @@ > _closeDelayMs: 500, > _loadTimer: null, > _closeTimer: null, > + _closingTimerNode: null, > + _overNode: null, _overNode should not be needed, since we already have it, see below :) @@ +756,5 @@ > + if (this._closeTimer && this._closingTimerNode === event.currentTarget) { > + this._closeTimer.cancel(); > + this._closingTimerNode = null; > + this._closeTimer = null; > + } please add a comment above this explaining the logic behind it ::: browser/components/places/content/controller.js @@ +1350,5 @@ > } > return false; > }, > > + draggingInAnchor: function PCDH_draggingInAnchor(node) { I don't think we need a further method here, you should fix draggingOverChildNode to properly detect we are dragging over the node... Even if its name seems to suggest it's only for child nodes of the passed-in node, it is also checking the node itself Actually it's possible the issue here is just that we should set PlacesControllerDragHelper.currentDropTarget in PlacesControllerDragHelper.onDragOver To clarify, currentDropTarget is a hint we give to draggingOverChildNode, we usually set it in the Places views during dragover/drop events, and unset it onDragEnd ::: browser/components/places/content/menu.xml @@ +238,5 @@ > + let helper = PlacesControllerDragHelper; > + let notDragging = helper.getSession() && > + !helper.draggingOverChildNode(popup.parentNode); > + notDragging = notDragging && !helper.draggingInAnchor(popup); > + if (notDragging) { I don't feel the need for this refactoring honestly.
Attachment #8370865 - Flags: review?(mak77) → review-
PS: in a few words currentDropTarget is your _overNode
(In reply to Marco Bonardo [:mak] from comment #10) > PS: in a few words currentDropTarget is your _overNode No, because it gets set to null. I checked. The popup drag handlers don't apply to the anchor.
You were right. This is much simpler, and seems to work as well.
Attachment #8371480 - Flags: review?(mak77)
Attachment #8370865 - Attachment is obsolete: true
Comment on attachment 8371480 [details] [diff] [review] adjust bookmarks drag code to not close the menu when over the menu button, Review of attachment 8371480 [details] [diff] [review]: ----------------------------------------------------------------- thanks ::: browser/base/content/browser-places.js @@ +754,5 @@ > > + /* > + * If we re-enter the same menu or anchor before the close timer runs out, > + * we should ensure that we do not close: > + */ please use // line comments here, makes easier to comment out parts of code when debugging
Attachment #8371480 - Flags: review?(mak77) → review+
Whiteboard: [Australis:P2] → [Australis:P2][fixed-in-fx-team]
Attached patch Patch for AuroraSplinter Review
Comment on attachment 8371501 [details] [diff] [review] Patch for Aurora [Approval Request Comment] Bug caused by (feature/regressing bug #): Australis User impact if declined: Dragging to the bookmarks menu doesn't work well Testing completed (on m-c, etc.): Local Risk to taking this patch (and alternatives if risky): relatively low. Dragging can't be much worse than it is now. String or IDL/UUID changes made by this patch: None.
Attachment #8371501 - Flags: review+
Attachment #8371501 - Flags: approval-mozilla-aurora?
Waiting for the patch to be applied in m-c.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [Australis:P2][fixed-in-fx-team] → [Australis:P2]
Target Milestone: --- → Firefox 30
Attachment #8371501 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Verified with latest builds on Nightly and Aurora
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: