Summary
On macOS, EventLoop::create_window currently ignores WindowAttributes::inner_size and only reads surface_size. If surface_size is None, it falls back to 800x600.
This causes unexpected clipping/cropping in apps that set logical size via inner_size (default path in many runtimes).
Reproduction
- Build/run an app that sets window size using
WindowAttributes::with_inner_size(...) but does not set with_surface_size(...).
- On macOS, create window through
EventLoop::create_window.
- Observe actual content area is
800x600 instead of the requested logical size.
Actual behavior
Window creation path falls back to 800x600 when surface_size is not set, even when inner_size is set.
Expected behavior
If surface_size is None but inner_size is set, create_window should respect inner_size (converted appropriately using scale factor), instead of falling back to 800x600.
Suspected root cause
In macos/window_delegate.mbt (EventLoop::create_window), size initialization currently does:
- read
attributes.surface_size()
- convert it with
to_physical(scale_factor)
- otherwise fallback
PhysicalSize::new(800, 600)
It does not check attributes.inner_size() in this branch.
Context
I hit this while running mgstudio examples. Layout was authored for a wider window, but actual macOS window ended up at 800x600, causing visible left/right clipping.
If useful, I can open a PR to add fallback order like:
surface_size
inner_size
- default
800x600
Summary
On macOS,
EventLoop::create_windowcurrently ignoresWindowAttributes::inner_sizeand only readssurface_size. Ifsurface_sizeisNone, it falls back to800x600.This causes unexpected clipping/cropping in apps that set logical size via
inner_size(default path in many runtimes).Reproduction
WindowAttributes::with_inner_size(...)but does not setwith_surface_size(...).EventLoop::create_window.800x600instead of the requested logical size.Actual behavior
Window creation path falls back to
800x600whensurface_sizeis not set, even wheninner_sizeis set.Expected behavior
If
surface_sizeisNonebutinner_sizeis set,create_windowshould respectinner_size(converted appropriately using scale factor), instead of falling back to800x600.Suspected root cause
In
macos/window_delegate.mbt(EventLoop::create_window), size initialization currently does:attributes.surface_size()to_physical(scale_factor)PhysicalSize::new(800, 600)It does not check
attributes.inner_size()in this branch.Context
I hit this while running
mgstudioexamples. Layout was authored for a wider window, but actual macOS window ended up at800x600, causing visible left/right clipping.If useful, I can open a PR to add fallback order like:
surface_sizeinner_size800x600