koekeishiya / yabai

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

How windows are determined to be eligible for management #2046

Open koekeishiya opened 6 months ago

koekeishiya commented 6 months ago

The following is an attempt to describe how exactly yabai determines that a window is eligible for management. "Management" entails that the window is allowed to have its properties modfied. If a window is not eligible for management, yabai has not touched a single property of said window; it is only tracked for debug purposes (e.g: we only read information about the window).

The situation is a bit messy because a lot of the elements that are visible on the screen on macOS is reported as "a window". There are multiple attributes reported through APIs that we can use to determine which type of window it is, but very often these attributes are not set correctly by the application/window. This applies to both Apple and third-party software, and makes this seemingly simple job of distinguishing between an application window, dialog window, popup window, autocomplete window, language input-switcher window, etc. quite difficult.

TODO: write stuff

localauthor commented 6 months ago

Just FYI, for anyone interested/searching, this change broke management of Emacs frames for me. Adding this rule seems to have fixed it:

yabai -m rule --add app="Emacs" role="AXTextField" subrole="AXStandardWindow" manage=on
rcorre commented 1 month ago

I've found that about 50% of the time when I open a wezterm window, it has an empty role/subrole, which results in the window being unmanaged.

These are two terminals I opened one after the other: manage.json unmanage.json

I tried yabai -m rule --add app="wezterm-gui" manage=on but it does not seem to do anything (I confirmed wezterm-gui is the app string from yabai -m query).

Any yabai -m window commands issued to that window print "could not locate the window to act on!".