sbmpost / AutoRaise

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

raises focus onto window behind menu bar dropdown of little snitch #205

Closed Lexvox closed 5 months ago

Lexvox commented 6 months ago

Problem: when clicking on a menu bar item of Little Snitch focus will get raised to the window beneath the dropdown. So far this only hapens with Little Snitch, all other apps work as expected, not raising focus to a window beneath a menu bar dropdown.

Expected: auto raise doesn't focus on a window behind a menu bar dropdown on all aps consitently

Reproduce: Open Little Snitch Rules in windowed mode, place it over another app eg. Finder, so that the window of the other app is directly beneath the menu bar. Focus Little Snitch, go to menu bar with cursor and open drop down. Hover over a menu dropdown item. Focus will shift to window beneath menu dropdown.

Window raise is disabled. Screenrecord attached.

https://github.com/sbmpost/AutoRaise/assets/53237831/9322d2d7-cbbf-4fe0-baef-a7a45e64466d

sbmpost commented 6 months ago

@Lexvox

See my reply on issue #204.

sbmpost commented 5 months ago

@Lexvox

Can I close this issue? The solution presented in #204 should get you going.

Lexvox commented 5 months ago

I tried the solution in #204 and it doesn't change the behavior. Only change is that it breaks layout of the settings ui somewhat.

Screenshot 2024-04-23 at 16 35 10

Restarted, no change.

I did not manage to use the command ./AutoRaise -focusDelay 1 -stayFocusedBundleIds "at.obdev.littlesnitch,at.obdev.littlesnitch.agent,at.obdev.littlesnitch.networkmonitor"

that you shared in #204 what dir do I run this in?

sbmpost commented 5 months ago

@Lexvox

The stayFocusedBundleIds setting in the UI is a comma separated list without spaces.

So if you copy paste this:

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

and confirm with the enter key after pasting, it should work. Hope that helps.

Lexvox commented 5 months ago

I did exactly that and did confirm with the enter key (and settings persisted the reboot)

sbmpost commented 5 months ago

@Lexvox

And the problem in the video persists I assume? The focus being stolen unexpectedly doesn't occur on my system with the settings I provided. So let's try to figure out why it still breaks on your system. One thing I can think of, is that you may be running two AutoRaise instances at the same time somehow. You can check this with the "Activity Monitor" app. If you (force) stop all AutoRaise instances from there, and then:

  1. Download the master branch

  2. Unpack downloaded zip with the terminal app:

    unzip -d ~ ~/Downloads/AutoRaise-master.zip

  3. Navigate to the unpacked folder and make the project, like so:

    cd ~/Downloads/AutoRaise-master && make clean && make CXXFLAGS="-DOLD_ACTIVATION_METHOD -DEXPERIMENTAL_FOCUS_FIRST"

  4. Start AutoRaise from the commandline with verbose and stayFocusedBundleIds settings:

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

Then hopefully we can see what is going on. I realize doing steps 1 - 4 might be a bit of a hassle, but probably the best place to start from in order to crush this issue ;-)

Lexvox commented 5 months ago

wierd.

does this mean theres two instances running bc if I understood correctly one of them is the actual app and the other one is simply the gui.

Screenshot 2024-04-28 at 14 40 40

I followed ur steps and with it running from my terminal it worked as expected.

reinstalled the app and after adding Little Snitch to stay focused everything works as expected.

also the ui glitch I showed in the last screenshot doesn't appear again.

I guess we can close this then. Guess there was something bugged abt my previous install / bug in front of the screen. 🙄

Thanks for your time and thanks for this very crucial app. Still boggles my mind this isn't just an option in macos.