MacPWAs: Open/save/certificate dialogs appear opens in Chrome process |
|||||
Issue descriptionTo 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: https://cs.chromium.org/chromium/src/ui/shell_dialogs/select_file_dialog_mac.h?rcl=b0b2c160fe79a296646cf11d53a084fa71d5f186&l=31 We'll need to the usual deal where the Cocoa bits are split out to be behind a separate interface.
,
Dec 11
Assigning to Alan to see if you can focus the window with this dialog.
,
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.
,
Dec 14
I have a "fix" out for this.
,
Dec 14
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a724b7656ccf728f169826b74f1eebe7af393053 commit a724b7656ccf728f169826b74f1eebe7af393053 Author: Christopher Cameron <ccameron@chromium.org> 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 NSWindow. Bug: 913303 Change-Id: Ife2fbddcd758ee0b028743a916d12cf8ce0f41f3 Reviewed-on: https://chromium-review.googlesource.com/c/1378017 Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org> Commit-Queue: ccameron <ccameron@chromium.org> Cr-Commit-Position: refs/heads/master@{#616772} [modify] https://crrev.com/a724b7656ccf728f169826b74f1eebe7af393053/chrome/browser/ui/views/certificate_viewer_mac_views.mm [modify] https://crrev.com/a724b7656ccf728f169826b74f1eebe7af393053/ui/base/BUILD.gn [add] https://crrev.com/a724b7656ccf728f169826b74f1eebe7af393053/ui/base/cocoa/remote_views_window.h [add] https://crrev.com/a724b7656ccf728f169826b74f1eebe7af393053/ui/base/cocoa/remote_views_window.mm [modify] https://crrev.com/a724b7656ccf728f169826b74f1eebe7af393053/ui/shell_dialogs/select_file_dialog_mac.mm [modify] https://crrev.com/a724b7656ccf728f169826b74f1eebe7af393053/ui/views/cocoa/bridged_native_widget_host_impl.h [modify] https://crrev.com/a724b7656ccf728f169826b74f1eebe7af393053/ui/views/cocoa/bridged_native_widget_host_impl.mm
,
Dec 17
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.
,
Dec 20
,
Dec 20
,
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?
,
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 |
|||||
Comment 1 by mgiuca@chromium.org
, Dec 11