koekeishiya / yabai

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

[Bug] focus on empty space fails occasionally #2313

Open aspauldingcode opened 4 months ago

aspauldingcode commented 4 months ago

Switching focus to different spaces with windows works 100% of the time for me. Switching focus to a space without windows works roughly 10% of the time at first, and then after spamming back and fourth commands it works more reliably like 20%.

No idea what's going on threre. The current behavior is yabai switches focus back to the space that HAD a window (which is usually the one it just came from) or focuses on the nearest space WITH a window (which happens when it just came from a space without a window in it).

Expected behavior: Switching focus to a different space should stay on that space after focus.

System Details: yabai-v7.1.1 macOS-v14.4.1 (aarch64) skhd-v0.3.9 (if it matters in this) SIP Disabled.

Bellavene commented 4 months ago

Turn desktop widgets off and the setting "click wallpaper to reveal desktop"

aspauldingcode commented 4 months ago

That doesn't seem to help me.. I'll keep trying things. Maybe I'll find a solution.

Bellavene commented 4 months ago

Have you any items on the desktop? I am asking because I don't have this issue, and I don't use desktop to store files.

aspauldingcode commented 4 months ago

I have createDesktop=false in defaults.

distek commented 3 months ago

Just for funzies:

> ls -al ~/Desktop/
drwx------ distek staff  64 B  Fri Jun 21 17:57:27 2024  .
drwxr-x--- distek staff 2.3 KB Fri Jun 21 17:57:55 2024  ..
>

This is after:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

To ensure no files get written without my consent.

As well as:

Turn desktop widgets off and the setting "click wallpaper to reveal desktop"

However, the problem still remains.

This occurs on my SIP disabled Mac, as well as my work SIP-very-much-enabled Mac.

summereasy commented 2 months ago

Turn desktop widgets off and the setting "click wallpaper to reveal desktop"

It's weird.

I have got the same problem here: tried to yabai -m display --focus west it won't response if that display (or space, more precisely) is empty.

I've tried everything until I saw your post... which I am pretty sure that click wallpaper to reveal desktop thing I've always set to OFF.

So, instead of keeping it off, I try to turn it on to see if some happens... and suddenly, Everything works again!

Thanks a lot. Saved me :/

koekeishiya commented 2 months ago

From the readme (and wiki):

Some people disable the Finder Desktop window using an undocumented defaults write command. This breaks focusing of empty spaces and should be avoided when using yabai. To re-activate the Finder Desktop, run: "defaults write com.apple.finder CreateDesktop -bool true".