Winit: with_maximized does not work

Created on 4 Jul 2019  路  3Comments  路  Source: rust-windowing/winit

OS: Windows 10 x64 version 1903
Winit version: Latest, cloned the repo @ this commit

It looks like with_maximized(true) creates a 1024x768 window at the top left of my screen instead of a maximized window.

Here's how to reproduce this:
1) Clone winit, git clone https://github.com/rust-windowing/winit
2) Use this example by chrisduerr, git apply window.diff
3) Run cargo run --example window
4) Observe that it does not produce a maximized window. Example: https://i.imgur.com/Qk8oGe2.jpg

Some closed PR's/issues claim that the issue got fixed, but it is not fixed for me. I'm not sure if this is a regression or not, sorry.
https://github.com/rust-windowing/winit/pull/672
https://github.com/rust-windowing/winit/issues/471 (identical results as me)

If this is a duplicate, feel free to close, I didn't see any current open issues that describe this problem.

Windows needs investigation bug

Most helpful comment

Hey, and thanks for the report!

This is happening because Winit currently applies the window's default size after maximization has been set. Fixing it is just a matter of not doing that, so I've made patch that should fix this.

All 3 comments

One thing to add, if you look at the window itself, it thinks it's maximized already. The icon is the "Restore" icon, not Maximize.

If I restore the created window, and re-maximize it manually, that works fine. It's just the initial startup that doesn't work.

Hey, and thanks for the report!

This is happening because Winit currently applies the window's default size after maximization has been set. Fixing it is just a matter of not doing that, so I've made patch that should fix this.

Awesome, glad it was easy to find/fix. Thanks for the quick response.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

felixrabe picture felixrabe  路  3Comments

rukai picture rukai  路  4Comments

e00E picture e00E  路  5Comments

chrisduerr picture chrisduerr  路  3Comments

nvzqz picture nvzqz  路  5Comments