asmvik / asmvik/yabai

Smartly respect window frame limitations

Open
#235 18 comments 20 reactions 0 assignees View on GitHub
discussion suggestion
Dominant language
C
Stars
29.6k
Forks
750
PR merge metrics
No merged PRs in 30d

Description

### Discussion / Feature request

This is an idea I've had for a while, and I want to discuss whether such a thing should be implemented and if it's actually possible. yabai currently distinguishes between resizable and non-resizable windows, but there is actually a third kind: those that are resizable but set a min/max width/height. I want to discuss how non-resizable and resizable windows with frame limitations can be handled better.

An important reminder early on: yabai does not lock windows to their nodes frame like chunkwm did, as this would apparently interfere with mouse support (https://github.com/koekeishiya/yabai/issues/28#issuecomment-499833214).

Window frame limitations may be detected by comparing the window nodes frame with the windows actual frame after resizing a window. As far as I can tell there is no API available for this. It is important that no we do not get caught in a resizing loop.

#### Centering windows

Windows whose frame may only be smaller than the frame desired by yabai should be centered in their window nodes frame.

#### Smarter split ratios

When a window is first assigned to a tree node (window created/deminimized, app launched/unhidden, window warped/unfloated etc.), if its frame may only be larger than the frame desired by yabai, its split ratio should be adjusted in both directions so it is an exact fit.

#### Overlapping inwards

When a window is larger than its desired frame, it should never overlap towards the display edges. Instead, it should overlap towards the screen center.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how yabai reads window frames, resizes windows, assigns them to tree nodes, and calculates split ratios; the issue names no files or tests. Investigate whether macOS exposes the needed frame limitations without causing a resizing loop. Done means handling undersized windows by centering them, adjusting ratios for oversized windows, and overlapping toward the screen center.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, macos
Domain
desktop, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.