Selecting a window with NSWindowCollectionBehaviorCanJoinAllSpaces causes other app to be activated

Number:rdar://37849561 Date Originated:2/23/2018
Status: Resolved:
Product:AppKit Product Version:10.12, 10.3.3
Classification: Reproducible:Always
Selecting a window whose collectionBehavior includes NSWindowCollectionBehaviorCanJoinAllSpaces from Exposé causes the window to briefly be front, main, and key and then another app is activated immediately after the Exposé animation finishes.

Use the attached app to reproduce.

Steps to Reproduce:
1. Launch any app, e.g. Xcode
2. Launch another app that creates a window with collectionBehavior including NSWindowCollectionBehaviorCanJoinAllSpaces. Position that window over Xcode's window.
3. Ensure the window with NSWindowCollectionBehaviorCanJoinAllSpaces is main & key and that its app is active
4. Four-finger swipe up to enter Exposé
5. Select the window with NSWindowCollectionBehaviorCanJoinAllSpaces

Expected Results:
The window you selected in Exposé is key & main and its app is active

Actual Results:
Expose animates out to reveal the selected window in front, but then another app (Xcode in my steps above) gets activated.

10.12 and 10.13.3

See sysdiagnose


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!