Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System Integrity Protection #1863

Open
koekeishiya opened this issue Sep 21, 2023 · 0 comments
Open

System Integrity Protection #1863

koekeishiya opened this issue Sep 21, 2023 · 0 comments
Labels
documentation Documentation

Comments

@koekeishiya
Copy link
Owner

koekeishiya commented Sep 21, 2023

The following features of yabai require System Integrity Protection to be (partially) disabled:

  • focus/move/swap/create/destroy space
  • remove window shadows
  • enable window transparency
  • enable window animations
  • scratchpad windows
  • control window layers (make windows appear topmost or on the desktop)
  • sticky windows (make windows appear on all spaces on the display that contains the window)
  • toggle picture-in-picture for any given window

If you do not care about the above set of features you can use yabai just fine without touching SIP settings.

I am aware of solutions that try to re-create some of these features without touching SIP, but the reality is that there is no way to implement said features properly without functional limitations, when SIP is enabled.

Now.. Why do these features require SIP to be disabled:

The entire spaces system in macOS is implemented in Dock.app, but uses some underlying API calls that are implemented in SkyLight.framework. To properly interact with spaces we need to inject code into the Dock process such that we are able to modify and update these internal datastructures.

In addition to this the Dock process is also flagged as a universal owner; its connection to the WindowServer has elevated privileges and is authorized to modify window properties that can otherwise only be set by the application whom the window belongs to.

To inject code into the Dock we use the mach APIs; in particular task_for_pid. With access to the task port we are able to load our own code into that process' address space to add additional capabilities. Injection is in-memory only and it does not alter any file on disk.

Repository owner locked as resolved and limited conversation to collaborators Sep 21, 2023
@koekeishiya koekeishiya added the documentation Documentation label Sep 21, 2023
@koekeishiya koekeishiya pinned this issue Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Documentation
Projects
None yet
Development

No branches or pull requests

1 participant