Closed Bug 2035989 Opened 2 months ago Closed 1 month ago

File > Open File... produces unusable file picker when no windows are open on macOS

Categories

(Core :: Widget: Cocoa, defect)

Firefox 152
defect

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox150 --- unaffected
firefox151 --- unaffected
firefox152 --- fixed

People

(Reporter: sam, Assigned: spohl)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Attached image file-picker.png

After bug 1909546, when all Firefox browser windows are closed, selecting File > Open File... produces a file picker mostly off-screen at the very bottom of the screen, which cannot be moved. It does function, but it's not really usable due to most of the contents being inaccessible.

Set release status flags based on info from the regressing bug 1909546

:spohl, since you are the author of the regressor, bug 1909546, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(spohl.mozilla.bugs)

I also noticed that if a non-browser window is focused, such as the Library or the About windows, those windows get the file picker instead of an open browser window.

It should probably use similar logic to the "Open Location..." menu item which finds an existing browser window or opens a new one if necessary.

Assignee: nobody → spohl.mozilla.bugs
Severity: -- → S3
Status: NEW → ASSIGNED
Flags: needinfo?(spohl.mozilla.bugs)

After bug 1909546 the macOS file picker is presented via
NSSavePanel/NSOpenPanel's beginSheetModalForWindow: API instead of the
old runModal flow. The sheet attaches to the parent window of the
browsingContext that nsIFilePicker.init was given. When the user
invokes File > Open File... from a window whose location is not the
browser chrome URL, the parent window is one of:

  • The macOS hidden menu-bar window
    (chrome://browser/content/hiddenWindowMac.xhtml), which is
    intentionally positioned off-screen — so the sheet appears at the
    very bottom of the screen, mostly clipped and not movable.
  • An auxiliary chrome window such as Library or About — so the
    sheet attaches to that window rather than to a real browser
    window.

Mirror the openLocation() pattern in BrowserCommands.openFileWindow:
when the calling window is not the browser chrome URL, find a
browser window via URILoadingHelper.getTargetWindow(window) and
dispatch the call there. If no browser window exists, open one and
re-issue the file-picker call after it loads.

Pushed by spohl@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f58e9441faa7 https://hg.mozilla.org/integration/autoland/rev/93d32ab12d44 Route File > Open File... to a browser window when invoked from a non-browser chrome window. r=mconley
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
QA Whiteboard: [qa-ver-opt-c153/b152]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: