SetFocus(Raise::Yes) does not activate the application on macOS, causes test failures
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox158 | --- | fixed |
People
(Reporter: florian, Assigned: florian)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
On macOS nsCocoaWindow::SetFocus(Raise::Yes) only calls [mWindow makeKeyAndOrderFront:nil], and AppKit will not make a window key while its application is inactive. Windows uses SetForegroundWindow and GTK uses gtk_window_present, so mac is the one platform where Raise::Yes does not honour its contract.
A browser-chrome test that launches the browser toolbox takes application activation away with -foreground and never gets it back. Every test after it then hangs in SimpleTest.waitForFocus(), waiting for a focus event that cannot arrive, which is the failure Bug 1937315 recorded when it was filed. Adding [NSApp activateIgnoringOtherApps:YES] on that path fixes it.
Updated•3 days ago
|
| Assignee | ||
Comment 1•3 days ago
|
||
Raise::Yes did nothing while Firefox was not the active application, where GTK
activates through gtk_window_present_with_time. Only nsFocusManager::RaiseWindow
reaches this on macOS, after BrowsingContext::CanFocusCheck grants the raise,
and mozilla.widget.raise-on-setfocus is a kill switch. The mac arms un-skipped
here are the browser-chrome harness waiting forever for a focus event once the
Browser Toolbox has taken activation: Bug 1937229, Bug 1937315, Bug 1767721,
Bug 1781499.
Comment 3•2 days ago
|
||
| bugherder | ||
Description
•