Skip to content

winemetal: fix MullionPlace uniform scaling and centering for emulated fullscreen modes - #368

Open
cyyever wants to merge 1 commit into
dttdrv:mainfrom
cyyever:pr/window-placement-scaling
Open

cyyever wants to merge 1 commit into
dttdrv:mainfrom
cyyever:pr/window-placement-scaling

Conversation

@cyyever

@cyyever cyyever commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extend WMTWindowPlacement (src/winemetal/winemetal.h, populated in src/mullion/mullion_window.hpp) with the top-level outer window dimensions (window_width, window_height) and primary screen height (screen_height).
  • Extract the placement geometry calculation into WMTComputeWindowPlacementRect() (src/winemetal/unix/mullion_placement.h) and call it from MullionPlace() (src/winemetal/unix/winemetal_unix.c):
    • Compute uniform scale as max(screen_width / cocoa_w, screen_height / cocoa_h) so emulated display modes with a different aspect ratio than the physical monitor (e.g., 16:10 or 21:9 on a 16:9 display) scale uniformly instead of overflowing or stretching.
    • Center borderless/fullscreen windows (window_width == top_level_width && window_height == top_level_height) on both axes for pillarboxing/letterboxing, while preserving the Wine-drawn border and caption calculation for decorated windows.
  • Add tests/host/window_placement.cpp (registered as host_window_placement in tests/host/meson.build) covering native 4K Retina fullscreen, 16:10 pillarboxed fullscreen, 21:9 letterboxed fullscreen, and decorated windows with child control offsets (flipped and unflipped).

Verification

  • Built and ran tests/host/window_placement.cpp locally with Apple Clang (-std=c++20 -Wall -Wextra): all cases passed.
  • Verified src/winemetal/unix/mullion_placement.h compiles cleanly as Objective-C (-Wall -Wextra) and src/mullion/mullion_window.hpp syntax-checks cleanly with x86_64-w64-mingw32-g++ -std=c++20 -Wall -Wextra.

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