sbmpost / AutoRaise

AutoRaise (and focus) a window when hovering over it with the mouse
GNU General Public License v3.0
1.42k stars 60 forks source link

Dropdown in Little Snitch is treated as another window #204

Closed ParsimoniousImpala closed 4 months ago

ParsimoniousImpala commented 4 months ago

Not sure if this is related to 203: I use Little Snitch which shows a floating alert window when an app is trying to connect. The dropdown menu in this window disappears when the mouse is moved away. The same happens with the Cancel button. Running AutoRaise 5.2 on Sonoma (but I've seen this behaviour on previous OS/AutoRaise versions as well).

https://github.com/sbmpost/AutoRaise/assets/148525881/7779b285-c14c-4167-89a8-96dcf653dbde

sbmpost commented 4 months ago

@ParsimoniousImpala

This is because the Little Snitch app does not support Accessibility which probably has to do with the UI framework it was built on. Turning on verbose logging in AutoRaise will show you this:

Copy element: no accessibility support

AutoRaise implements a fallback, finding the window below the mouse by iterating over all windows and see if the mouse pointer is bounded by any of them. The window z-order is also taken into account. If a window is found this way, it is activated. This fallback usually works, but for applications with multiple windows that do not support accessibility, it may not be appropriate.

I will be adding an exception in AutoRaise for Little Snitch, so that the fallback won't happen. Unfortunately this means no auto focus/raise support when moving the mouse over this particular app. I think this is still better than the behaviour shown in the video and in issue #205

sbmpost commented 4 months ago

@ParsimoniousImpala

Thinking some more about this issue, perhaps adding the bundle id to the stayFocusedBundleIds list may already improve the situation. I will do some tests tomorrow.

ParsimoniousImpala commented 4 months ago

Thank you very much for your replies!

Thinking some more about this issue, perhaps adding the bundle id to the stayFocusedBundleIds list may already improve the situation. I will do some tests tomorrow.

Ah! That way! I tried it with 'Little Snitch' in the "Ignore apps" field which did not change anything. Will need to check if it works the other way. (The difference between "Ignore titles" and "Stay focused" is not that clear to me.)

sbmpost commented 4 months ago

@ParsimoniousImpala

The solution is to add these to the stayFocusedBundleIds parameter:

at.obdev.littlesnitch
at.obdev.littlesnitch.agent
at.obdev.littlesnitch.networkmonitor

You can do this either in the UI (don't forget to confirm with the enter key) or on the commandline. For example:

./AutoRaise -focusDelay 1 -stayFocusedBundleIds "at.obdev.littlesnitch,at.obdev.littlesnitch.agent,at.obdev.littlesnitch.networkmonitor"

After this, also the Little Snitch menu items on the menu bar should no longer disappear (see #205). The agent menu however (accessible via the menu bar icon) may still disappear which can't be easily solved.

sbmpost commented 4 months ago

@ParsimoniousImpala

Can this issue be closed? See the solution above.

ParsimoniousImpala commented 4 months ago

Sure! Works like a charm. Thanks again!