Skip to content

Preserve absolute frame coordinates on secondary displays#8

Open
TechDufus wants to merge 1 commit intojesseleite:masterfrom
TechDufus:fix/absolute-frame-coordinates
Open

Preserve absolute frame coordinates on secondary displays#8
TechDufus wants to merge 1 commit intojesseleite:masterfrom
TechDufus:fix/absolute-frame-coordinates

Conversation

@TechDufus
Copy link
Copy Markdown
Contributor

What changed

Preserve 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
  • add a focused regression in tests/helpers_spec.lua that exercises a negative-x frame and asserts the absolute-coordinate options are present

Why

Displays positioned left or above the primary display use negative global coordinates. hs.layout.apply() interprets negative frame coordinates as offsets unless the row opts into absolute positioning.

Without those options, a valid frame for a secondary display can be remapped onto the primary display instead of being applied where it belongs.

Validation

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

@TechDufus TechDufus force-pushed the fix/absolute-frame-coordinates branch from b437c0a to 3e14522 Compare April 1, 2026 16:01
@TechDufus TechDufus marked this pull request as ready for review April 1, 2026 16:01
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