Skip to content

On Windows, fix window shrinking when leaving fullscreen in some situations - #718

Merged
francesca64 merged 6 commits into
rust-windowing:masterfrom
Osspial:fix_fullscreen_decorations_shrink
Nov 20, 2018
Merged

francesca64 merged 6 commits into
rust-windowing:masterfrom
Osspial:fix_fullscreen_decorations_shrink

Conversation

@Osspial

@Osspial Osspial commented Nov 20, 2018 •

Copy link
Copy Markdown
Contributor
  • Tested on all platforms changed
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users

Fixes #715. This seems to have been caused by the window style getting improperly set when leaving fullscreen mode.

The Windows fullscreen window restore code is a bit convoluted in general so I'd like to take some time to refactor and simplify that a bit, but this can be fixed without doing that.

@francesca64 francesca64 added the DS - win32 Affects the Win32/Windows backend label Nov 20, 2018
@francesca64

francesca64 commented Nov 20, 2018 •

Copy link
Copy Markdown
Member

Thanks for the quick fix! I think a CHANGELOG entry would be nice.

This introduces another fun bug that makes the window grow:

  1. Enter fullscreen with decorations on
  2. Exit fullscreen with decorations off
  3. Repeat

@Osspial

Osspial commented Nov 20, 2018

Copy link
Copy Markdown
Contributor Author

@francesca64 Heh, funny that this would add a bug that does exactly the opposite of the original bug! Regardless, Windows now saves the client rect instead of the adjusted window rect when we enter fullscreen so this and any similar issues should be fixed.

@francesca64

Copy link
Copy Markdown
Member

Awesome! This next one isn't a regression, but might make sense to tackle here too:

  1. Maximize with decorations off
  2. Un-maximize with decorations on
  3. Repeat

This progressively makes the window shorter by the same height as the title bar.

@Osspial

Osspial commented Nov 20, 2018

Copy link
Copy Markdown
Contributor Author

We're using the official Windows restore-size-from-maximize function there, so fixing that would involve a bit more work than I'm willing to do in this PR. I'm working on a bigger refactor to the Windows style-flags code though (which touches that), so I'll see about fixing it in that.

@francesca64

Copy link
Copy Markdown
Member

Alright, sounds great!

@francesca64
francesca64 merged commit aabf0e1 into rust-windowing:master Nov 20, 2018
@Osspial Osspial mentioned this pull request Nov 29, 2018
4 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DS - win32 Affects the Win32/Windows backend

Development

Successfully merging this pull request may close these issues.

Windows: Toggling between decorations and fullscreen shrinks window

2 participants