Skip to content

Preserve absolute frame coordinates on secondary displays#2

Closed
TechDufus wants to merge 1 commit intomasterfrom
fix/absolute-frame-coordinates
Closed

Preserve absolute frame coordinates on secondary displays#2
TechDufus wants to merge 1 commit intomasterfrom
fix/absolute-frame-coordinates

Conversation

@TechDufus
Copy link
Copy Markdown
Owner

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
Copy link
Copy Markdown
Owner Author

Superseded by upstream PR jesseleite#8.

@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