Post

Replies

Boosts

Views

Activity

Behavior change in NSRunningApplication's activateWithOptions starting with Big Sur
My application uses the keyboard to give focus to particular windows rather than clicking with the mouse. (I have a hand tremor that causes my mouse clicks to frequently miss the intended target.) The application: uses the AppKit "Accessibility for macOS" API to select a window. It calls the AXUIElementSetAttributeValue function to set the attribute NSAccessibilityMainAttribute to make a window "main" and then calls NSRunningApplication's method activateWithOptions: passing only NSApplicationActivateIgnoringOtherApps to activate the app associated with that window. Based on the documentation for the activateWithOptions: method, which says: By default, activation brings only the main and key windows forward. If you specify NSApplicationActivateAllWindows, all of the application's windows are brought forward. and the fact that I am not passing NSApplicationActivateAllWindows, I expect only the main window (which is also the key window) to move forward. However, all the windows of the app being activated are brought forward, obscuring windows from other apps. For example, if I am running two apps AppX and AppY with windows X1 and Y1 covering the left half of the screen and windows X2 and Y2 covering the right half of the screen If I start with windows X1 and X2 visible, then make window Y2 "main" and activate app AppY with activateWithOptions:, I would expect to be able to see windows X1 and Y2 with window Y2 receiving keyboard input. That is the behavior I saw prior to Big Sur. Since upgrading to Big Sur, however, when AppY is activated, both window Y1 and Y2 are brought forward.
5
0
1.1k
Dec ’20