Closed Bug 1544167 Opened 5 years ago Closed 2 years ago

End drags when creating new dialog windows (e.g. download dialog or desktop notifications on Windows)

Categories

(Core :: Window Management, defect, P3)

defect

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: sfoster, Assigned: Gijs)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

(Whiteboard: [fidefe-quality-foundation])

Attachments

(1 file)

See bug 1538460 and https://bugzilla.mozilla.org/show_bug.cgi?id=1538460#c17

On windows, when a modal dialog is shown while a drag is in progress, using the mouse to click on that dialog puts us in a weird state where the drag ends at that mouseup. Not clicking on the modal (e.g. using the keyboard to dismiss it) is weirder still as a new drag session is apparently created after some timeout.

:enn suggests "Probably EventStateManager::mGestureDownContent is set while the modal dialog occurs. If that's the case, it should be cleared by calling StopTrackingDragGesture()",

There's more detail in https://bugzilla.mozilla.org/show_bug.cgi?id=1538460#c21

Component: XUL → Drag and Drop
Priority: -- → P3
Blocks: 1567574
Blocks: 1542353
See Also: 1542353
See Also: → 1593586
Blocks: 1721308
Assignee: nobody → gijskruitbosch+bugs
Whiteboard: [fidefe-quality-foundation]
Severity: normal → S2

Olli, I've been looking at this, bug 1542353 and bug 1593586. AFAICT for a "normal" modal prompt (Services.prompt.confirmExBC(docShell.browsingContext, Ci.nsIPrompt.MODAL_TYPE_WINDOW, "Hello", "Hello", 0, "OK", "Cancel", "", null, {})), this already works today, so nothing here needs to happen. Adding a call to StopTrackingDragGesture doesn't seem to matter.

However... the disruption to the drag operation is not limited to modal operations; the desktop notification (on Windows, at least, see testcase in bug 1593586 comment 4) and the download prompt (non-modal dialog, on nightly you may need to set browser.download.improvements_to_download_panel to false to repro) both run into this issue.

I can fix the downloads prompt (bug 1542353) by cheating and making the JS call opening the dialog call enterModalState and leaveModalState on the parent window, but that seems very wrong.

Do you have any ideas about where we should be stopping drags if not inside EnterModalState?

Flags: needinfo?(bugs)

Ok, so sounds like the issue isn't about modal dialogs.
The (old?) download dialog is some kind of always-on-top-but-not-modal. So I'd look at either WindowWatcher code or Widget level code to clear current dnd when we open such thing.

Flags: needinfo?(bugs)
Summary: Clear EventStateManager::mGestureDownContent when a modal dialog is shown → End drags when creating new dialog windows (e.g. download dialog or desktop notifications on Windows)
Pushed by gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/c738cce970b5
end drag sessions when creating dialog chrome windows, r=smaug
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
Blocks: 1593586
See Also: 1593586

Backed out for causing perma failures on browser_popup_condition.js

[task 2021-12-20T02:07:31.308Z] 02:07:31     INFO - TEST-PASS | toolkit/components/windowwatcher/test/browser_popup_condition.js | CHROME_SCROLLBARS should be present for features "noreferrer" - true == true - 
[task 2021-12-20T02:07:31.308Z] 02:07:31     INFO - TEST-PASS | toolkit/components/windowwatcher/test/browser_popup_condition.js | CHROME_TITLEBAR should be present for features "noreferrer" - true == true - 
[task 2021-12-20T02:07:31.309Z] 02:07:31     INFO - TEST-PASS | toolkit/components/windowwatcher/test/browser_popup_condition.js | CHROME_MENUBAR should be present for features "noreferrer" - true == true - 
[task 2021-12-20T02:07:31.309Z] 02:07:31     INFO - TEST-PASS | toolkit/components/windowwatcher/test/browser_popup_condition.js | CHROME_TOOLBAR should be present for features "noreferrer" - true == true - 
[task 2021-12-20T02:07:31.310Z] 02:07:31     INFO - TEST-PASS | toolkit/components/windowwatcher/test/browser_popup_condition.js | CHROME_PERSONAL_TOOLBAR should be present for features "noreferrer" - true == true - 
[task 2021-12-20T02:07:31.310Z] 02:07:31     INFO - Leaving test bound test_popup_conditions
[task 2021-12-20T02:07:31.310Z] 02:07:31     INFO - Buffered messages finished
[task 2021-12-20T02:07:31.311Z] 02:07:31     INFO - TEST-UNEXPECTED-FAIL | toolkit/components/windowwatcher/test/browser_popup_condition.js | This test exceeded the timeout threshold. It should be rewritten or split up. If that's not possible, use requestLongerTimeout(N), but only as a last resort. - 
[task 2021-12-20T02:07:31.311Z] 02:07:31     INFO - GECKO(7882) | MEMORY STAT | vsize 11618MB | residentFast 576MB | heapAllocated 274MB
[task 2021-12-20T02:07:31.312Z] 02:07:31     INFO - TEST-OK | toolkit/components/windowwatcher/test/browser_popup_condition.js | took 256381ms
[task 2021-12-20T02:07:31.313Z] 02:07:31     INFO - checking window state
[task 2021-12-20T02:07:31.313Z] 02:07:31     INFO - GECKO(7882) | Completed ShutdownLeaks collections in process 7882
Status: RESOLVED → REOPENED
Flags: needinfo?(gijskruitbosch+bugs)
Resolution: FIXED → ---
Target Milestone: 97 Branch → ---

Per conversations in #sheriffs, given this was on central for nearly 2 weeks, and given that this is only failing for Linux with hardware webrender enabled, whereas by default, the test only runs with software webrender - I am going to reland the patch as-is and file a follow-up for this test (which apparently is slower under linux hw webrender, for reasons we don't really know - there was an existing TV failure in bug 1739753, where the test actually fails on its very first run (ie somehow the preceding tests in the same folder are making it faster when run in its directory... so it's already pretty flaky).

Flags: needinfo?(gijskruitbosch+bugs)
Pushed by gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/22d928422120
end drag sessions when creating dialog chrome windows, r=smaug
Blocks: 1746848
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
Component: DOM: Copy & Paste and Drag & Drop → Window Management
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: