DescriptionMac: Use activateIgnoringOtherApps instead of SetFrontProcessWithOptions to focus app windows
Yet another attempt at finding a workaround for the two-windows-have-key-
status bug that can affect packaged app windows on Mac.
Currently, NativeAppWindowCocoa activates Chrome with
::SetFrontProcessWithOptions() called via +[BrowserWindowUtils
activateWindowForController:]. ChromeNativeAppWindowViewsMac calls
-[NSApplication activateIgnoringOtherApps:YES].
After running with the MacViews app window flag for a month I didn't encounter
this bug. Minutes after disabling the flag and returning to
NativeAppWindowCocoa, I got a repro. (Although, a week later, not a second repro).
SetFrontProcess() is deprecated with the note in HIServices/../Processes.h:
* Deprecated:
* To make your own application frontmost, use
* [[NSApplication sharedApplication] activateIgnoringOtherApps: YES].
SetFrontProcessWithOptions() is deprecated with the note:
* Deprecated:
* See SetFrontProcess().
We lose the `kSetFrontProcessFrontWindowOnly` argument to "bring only the
frontmost non-floating window forward", but a quick check suggests this is the
default for activateIgnoringOtherApps: anyway.
SetFrontProcessWithOptions() has been around since http://crrev.com/6647009
BUG=459306
Committed: https://crrev.com/3c44dfef03524ac42b74916de37248bb4cb919c8
Cr-Commit-Position: refs/heads/master@{#342773}
Patch Set 1 #
Dependent Patchsets: Messages
Total messages: 7 (2 generated)
|