New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 5 users

Issue metadata

Status: Assigned
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug

Sign in to add a comment

Issue 913303: MacPWAs: Open/save/certificate dialogs appear opens in Chrome process

Reported by, Dec 10 Project Member

Issue description

To reproduce:
- Open Killer Marmot PWA
- Right-click save as (or open, etc, etc, etc)
- Notice that the dialog opens in a Chrome window behind the expected window

See attached video.

IIUC the relevant code is this area:

We'll need to the usual deal where the Cocoa bits are split out to be behind a separate interface.
3.2 MB View Download

Comment 1 by, Dec 11

Keeping this as P1, because it opens behind the window.

If we can *focus* the opened window (but not migrate it to the shim process) then this is still a bug, but I think it drops down to a P3.

Comment 2 by, Dec 11

Status: Assigned (was: Untriaged)
Assigning to Alan to see if you can focus the window with this dialog.

Comment 3 by, Dec 13

I think that the easiest 'fix' for this is to use the dialog in Chrome, but superimpose it on top of the PWA window. See the attached video for what happens when we just add
  [owning_window setLevel:NSModalPanelWindowLevel];
to SelectFileDialogImpl::SelectFileImpl

That gets us most of the way -- a few issues
- the dialog is above other windows of other processes (not a big deal)
- Chrome retains focus after the dialog goes away
  - we'll need to make the PWA re-take focus when the dialog is dismissed

This should be acceptable for 73.
4.7 MB View Download

Comment 4 by, Dec 14

I have a "fix" out for this.

Comment 5 by, Dec 14

Project Member
The following revision refers to this bug:

commit a724b7656ccf728f169826b74f1eebe7af393053
Author: Christopher Cameron <>
Date: Fri Dec 14 19:02:42 2018

RemoteMacViews: Make certificate and file dialogs better

The certificate and file selection dialogs have not been adapted to be
able to run across processes using mojo.

At present, these dialogs appear behind their expected window, and
appear in the Chrome process. Make this situation better by making
them appear in front of their window (and, in front of everything).

Because some of these positioning decisions are made before the
true window geometry has been communicated back to the browser process,
more aggressively push geometry changes to the in-browser-process

Bug: 913303
Change-Id: Ife2fbddcd758ee0b028743a916d12cf8ce0f41f3
Reviewed-by: Elly Fong-Jones <>
Commit-Queue: ccameron <>
Cr-Commit-Position: refs/heads/master@{#616772}

Comment 6 by, Dec 17

Labels: -Pri-1 Pri-2
Summary: MacPWAs: Open/save finder dialogs appear opens in Chrome process (was: MacPWAs: Open/save finder dialogs appear in wrong process and behind window)
This is now better, but switches the app focus (inappropriately) to Chrome when the dialog closes. Might be reasonable to drop to P2 at this point.

Comment 7 by, Dec 20

 Issue 916815  has been merged into this issue.

Comment 8 by, Dec 20

Summary: MacPWAs: Open/save/certificate dialogs appear opens in Chrome process (was: MacPWAs: Open/save finder dialogs appear opens in Chrome process)

Comment 9 by, Jan 9

This manifests in other ways, e.g.:

1. Have Gmail as a PWA
2. Attach a screenshot

When the dialog closes, focus switches to Chrome. That's actually kind of annoying. Is it worth upping the priority again to address the focus issue?

Comment 10 by, Jan 9

Yeah, I had plans to add something to re-focus the PWA when the "pretend" window went away, but I didn't get around to it. It should be easy to add (will definitely be done before branch, probably not FF, cause that's like-today-or-so).

Sign in to add a comment