Chromium Code Reviews
DescriptionMac: Give packaged app windows their own window cycle list.
For now it's behind chrome://flags#app-window-cycling.
This is to hopefully give a better UX for App Shims. It also solves a
tricky problem with Chrome Remote Desktop: Since CRD swallows Cmd+`, it
breaks browser window cycling since the cycling will stop as soon as a
CRD window is encountered.
This works by hooking in to the same mechanism that changes the menu
bar. Switching to or away from a packaged app window will now also update
the window cycle list. The CL intentionally does *not*:
- try to distinguish between the same app running in different profiles,
- update the `Window` menu, nor
- try to do anything for Cmd+Tab switching.
The hard part: AppKit does not immediately apply changes to
NSWindowCollectionBehaviorIgnoresCycle after a window is already shown.
An effective workaround seems to be call to [[NSApp keyWindow]
makeKeyAndOrderFront:nil]. However, this may have other consequences.
Lots of other things were tried (see code comments).
Adds an interactive UI test. Tests on mac using
ui_test_utils::ShowAndFocusNativeWindow(..) have a history of flakiness,
so this CL attempts to address that by combining with a notification
observer. This approach has successfully addressed flakiness around
key-window transitions elsewhere. It would commonly occur when multiple
windows are in the process -- a single RunLoop().RunUntilIdle() couldn't
guarantee that the window server had completed the switch.
BUG=484737, 278408
Committed: https://crrev.com/91f299c14448905eaeaf635c86d3d527241d02e7
Cr-Commit-Position: refs/heads/master@{#336063}
Patch Set 1 #Patch Set 2 : Implemented. But Flaky. No idea why. #Patch Set 3 : Tracing. Yep: seems AppKit happily includes NSWindowCollectionBehaviorIgnoresCycle in _getLockedWin… #Patch Set 4 : Something that works! But.. it is a bit scary still #Patch Set 5 : Add command line flag #Patch Set 6 : WIP #Patch Set 7 : A test! #Patch Set 8 : nits #Patch Set 9 : Now testing without the private API #
Total comments: 2
Patch Set 10 : rebase (conflicts with r335465) #Patch Set 11 : Support jumps #
Total comments: 2
Patch Set 12 : extension || is_browser + cl format #
Total comments: 4
Patch Set 13 : rebase #Patch Set 14 : rsesek comments #Patch Set 15 : rebase (overlap with r335812 and I want a fresh CQ run) #Messages
Total messages: 24 (10 generated)
|