On Windows, fix window size for maximized, undecorated windows#2584
Merged
msiglreith merged 8 commits intorust-windowing:masterfrom Jan 28, 2023
Merged
Conversation
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
amrbashir
suggested changes
Dec 6, 2022
Contributor
amrbashir
left a comment
There was a problem hiding this comment.
Thank you for the attribution, unfortunately a bug with this code came to light since then, see below.
| if util::is_maximized(window) { | ||
| // Limit the window size when maximized to the current monitor. | ||
| // Otherwise it would include the non-existent decorations. | ||
| let monitor = monitor::current_monitor(window); |
Contributor
There was a problem hiding this comment.
using monitor::current_monitor which uses MonitorFromWindow and MONITOR_DEFAULTTONEAREST is unreliable in this situation, see MicrosoftEdge/WebView2Feedback#2549 (comment), instead, MonitorFromRect should be used
Member
Author
There was a problem hiding this comment.
thanks for mentioning this! I will adjust it accordingly
Member
|
@msiglreith is this good to go? |
Member
Author
|
not yet, I will update it today |
# Conflicts: # CHANGELOG.md
…ed-undecorated # Conflicts: # CHANGELOG.md # src/platform_impl/windows/util.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mostly takes the relevant pieces from #1891 regarding max window handling which haven't been included so far.
Attributed @amrbashir in the commit accordingly, I hope that's fine!
Fixes #2568
CHANGELOG.mdif knowledge of this change could be valuable to users