koekeishiya / yabai

A tiling window manager for macOS based on binary space partitioning
MIT License
23.87k stars 650 forks source link

`focus_follows_mouse` stops working #2217

Open farzadmf opened 7 months ago

farzadmf commented 7 months ago

Hi, the foucs_follows_mouse is a SUPER important feature to me (I've set it to autofocus).

After the recent yabai update, the feature seems to be very unreliable, and it stops working.

Yesterday, I noticed that when I was focusing Chrome, it stops working, so I closed Chrome and re-opened, and it was fine. But, today, after restarting my computer, it just stops working 2 seconds after I restart yabai.

I must add that this might be coming from MacOS itself, since my alternate solution (AutoRaise) seems to not be working either.

Is there any way I can help debug this issue? It broke my whole flow of using stupid MacOS 🙁

supermar1010 commented 7 months ago

I have the same issue, my workaround rn is to have a shell script execute yabai -m config focus_follows_mouse autofocus every 60 seconds :D that works perfectly so far

For fish:

while True; yabai -m config focus_follows_mouse autofocus; sleep 60; end
matthiasantierens commented 7 months ago

Same here!

matheusfillipe commented 6 months ago

Same here.

jgallinari commented 6 months ago

Ended up doing the same as @supermar1010 because can't live without, but it bothers me... For zsh:

❯ for ((;;))source ~/.yabairc && sleep 60

with .yabairc containing yabai -m config focus_follows_mouse autofocus

farzadmf commented 6 months ago

I think (not 100% sure TBH) that if I run yabai from the command line (basically do a yabai --stop-service and "manually" run it using yabai (or yabai -V of you want to see the logs), it seems to be working fine.

The reason I said I "think" it's working is that, for now, I have to be single monitor (and I have a single window per monitor), so I can't fully test it for now

EDIT: well, I spoke too soon; it's not working, so I think I also need to go the yabai -m config ... route 🤷

dalsvk commented 6 months ago

same here, it stops working after a few seconds :(

dalsvk commented 6 months ago

Upgrading to 14.5 beta seems to have fixed it for me, for now!

Edit: Stopped working :(

fabiosenracorrea commented 6 months ago

14.4.1 here, same thing. Configured the script to run every 60s and on startup and its now working properly. Didnt want to do this, but can't live without it.

farzadmf commented 6 months ago

You guys are too patient, I'm doing it every 2s 😆

zannis commented 6 months ago

Thanks for the fix guys, it was driving me crazy, hope this gets fixed soon 🙏🏼

puchupala commented 6 months ago

Seem like a perfect use for cron job. I set a cron job to run every minute.

# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7)  OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  *  command to be executed
# *  *  *  *  *  command --arg1 --arg2 file1 file2 2>&1
* * * * * /opt/homebrew/bin/yabai -m config focus_follows_mouse autofocus
farzadmf commented 6 months ago

@puchupala I've been creating cronjobs for different things, but for some reason, didn't think of using one for this; thank you for the reminder!

jgallinari commented 5 months ago

I think we're good with Sonoma 14.5 😌

tiago-garcia-deel commented 5 months ago

seems to happen more frequently to me ever since MacOS 14.5

ognistik commented 4 months ago

Since someone else mentioned it happened when clicking links inside the browser (I figured in my case it happened with Arc), adding a signal to my yabairc seems to work and I find it better than having to run code every minute or so.

yabai -m signal --add app="^Arc$" event=window_title_changed action="yabai -m config focus_follows_mouse autoraise"
alber70g commented 4 months ago

I'm totally guessing here but could it be related to this somehow? Now that yabai is responding to more events, the OS is not happy with that?

https://github.com/koekeishiya/yabai/issues/1958#issuecomment-1994444380