Skip to content

Preserve absolute frame coordinates on secondary displays#1

Closed
TechDufus wants to merge 5 commits intomasterfrom
feat/screen-aware-cells
Closed

Preserve absolute frame coordinates on secondary displays#1
TechDufus wants to merge 5 commits intomasterfrom
feat/screen-aware-cells

Conversation

@TechDufus
Copy link
Copy Markdown
Owner

What changed

This preserves absolute frame coordinates when GridLayout applies frame-based placements through hs.layout.apply().

  • add options.absolute_x = true and options.absolute_y = true to normalized layout rows in helpers.lua
  • extend tests/helpers_spec.lua to assert those flags for legacy and screen-aware cells

Why

A display positioned to the left or above the primary display uses negative global coordinates. GridLayout computes the correct absolute frame for that screen, but hs.layout.apply() treats negative frame.x and frame.y values as offsets unless the row opts into absolute coordinates.

That caused layout changes on a secondary display to pull windows back onto the primary display instead of applying the frame on the intended screen.

Impact

Screen-aware and legacy frame-based placements now preserve the real global coordinates of the target display, so layouts continue to apply correctly on non-primary displays with negative origins.

Validation

  • lua tests/helpers_spec.lua
  • luac -p helpers.lua grid.lua tests/helpers_spec.lua

@TechDufus TechDufus changed the title [codex] Preserve absolute frame coordinates on secondary displays Preserve absolute frame coordinates on secondary displays Apr 1, 2026
@TechDufus
Copy link
Copy Markdown
Owner Author

Superseded by #2. #1 was opened from an existing feature branch and included unrelated screen-aware-cells history.

@TechDufus TechDufus closed this Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant