Skip to content

Fix ShrinkTo computing a wrong bottom edge - #491

Open
SQReder wants to merge 1 commit into
FancyWM:mainfrom
SQReder:fix/shrink-to-bounds
Open

SQReder wants to merge 1 commit into
FancyWM:mainfrom
SQReder:fix/shrink-to-bounds

Conversation

@SQReder

@SQReder SQReder commented Sep 21, 2026 •

Copy link
Copy Markdown

Context

TilingService.ShrinkTo centers a fixed-size rectangle inside a container. It is used to place windows that cannot be resized. The bottom edge was computed as container.Height - wdiff / 2 — the container height instead of its bottom, and the width difference instead of the height difference — so those windows were given a bogus target rectangle.

Changes

  • Derive the right and bottom edges from the requested size (left + width, top + height), so the size is preserved exactly, including when the size difference is odd.

Verification

  • dotnet build FancyWM.GUI (Release) — 0 errors.
  • Not exercised at runtime with an unresizable window; unit tests were not run locally.

Risks

  • None known. The change is confined to the unresizable-window branch of CalculateRepositionTargets.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

The bottom edge was derived from the container height and the width
difference instead of the container bottom and the height difference,
so unresizable windows were given a bogus target rectangle. Derive the
right and bottom edges from the requested size so it is preserved
exactly, including for odd size differences.
@SQReder
SQReder force-pushed the fix/shrink-to-bounds branch from 4dd61b5 to 297254c Compare September 21, 2026 15:32

This branch has not been deployed

No deployments
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