Opening a new window from macOS dock should set opener from existing window
Categories
(Firefox :: General, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox129 | --- | fixed |
People
(Reporter: sclements, Assigned: Gijs)
Details
Attachments
(1 file)
This came up in our sidebar work, where opener
is null if you try to open a second window via the right-click menu from Firefox in the macOS dock. Since this has implications for persisting sidebar state (which relies on inheriting state from an existing window) and its inconsistent with what menubar and keyboard shortcuts do we should change this.
There was discussion in matrix #macdev channel and I'm gonna copy/paste what Gijs said:
so it looks like we construct the dock menu based on a DOM menu similar to how other menus (like the menubar menu) work, cf. https://searchfox.org/mozilla-central/rev/1d1ca77dd7ca10953c6f5f1b77b98e4eb528274e/browser/base/content/nonbrowser-mac.js#95
that points to https://searchfox.org/mozilla-central/source/browser/base/content/hiddenWindowMac.xhtml#25
which points to https://searchfox.org/mozilla-central/rev/1d1ca77dd7ca10953c6f5f1b77b98e4eb528274e/browser/base/content/nonbrowser-mac.js#14-28
which does call OpenBrowserWindow but doesn't in any way override the openerWindow, so that's going to keep being the mac hidden window (ie hiddenWindowMac.xhtml` in the earlier link) rather than a browser window
if we wanted to fix this we'd need to do 2 things:
- create a way to give OpenBrowserWindow an optional arg to override the passed openerWindow, or make the code in nonbrowser-mac.js directly invoke BrowserWindowTracker such that it bypasses OpenBrowserWindow and passes the openerWindow directly.
- figure out which is the "right" openerWindow to pass. In some cases (<=1 window open) it's easy. In some other cases (multiple windows across multiple desktops, some of which may be in private windows), it's less obvious. A first pass would probably to "just" use BrowserWindowTracker.getTopWindow(), which ignores popups and private state by default (so "just" the most recent window without any other filtering)
Reporter | ||
Updated•4 months ago
|
Assignee | ||
Updated•4 months ago
|
Assignee | ||
Comment 1•4 months ago
|
||
Updated•4 months ago
|
Updated•4 months ago
|
Comment 3•3 months ago
|
||
bugherder |
Description
•