-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Starting an app with WindowState::Maximized
doesn't work quite right on macOS
#1690
Comments
The problem is here: druid/druid-shell/src/platform/mac/window.rs Lines 289 to 301 in e60b2ab
On line 290, it correctly calls I added the first two lines - and sorry if this is absolutely the wrong way to do it, I'm not at all familiar with how mac OS windowing works - and it worked. The first layout call now sees the correct maximized window size. // set_window_state above could have invalidated the frame size
let frame = NSView::frame(content_view);
(*view_state).handler.connect(&handle.clone().into());
(*view_state).handler.scale(Scale::default());
(*view_state)
.handler
.size(Size::new(frame.size.width, frame.size.height)); |
yep this looks good to me, feel free to PR if you want! |
…t widgets properly at startup).
…t widgets properly at startup).
I'm on macOS 10.15.5 and using the git version of Druid (post-0.7.0).
After posting a topic and repro on Zulip, we discovered that this code properly creates a maximized window on Windows, but not on macOS. The issue is that the window is maximized, but the widget layout is not. It still thinks the window is like 400x300 pixels or something. If I then resize the window, the layout corrects itself.
Screenshot of what it looks like:
The text was updated successfully, but these errors were encountered: