-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix - Missing Shadow - OSX and Window Position #5963
Merged
Merged
Conversation
This file contains 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
When window is not shown, and Resize is called, it will trigger a Resize event, that updates ClientSize.
MarchingCube
approved these changes
May 22, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on Windows and Linux (Mint) and it seems to work fine. I guess in between previous PR that moved this code and now there were changes to window sizing so it just works now.
danwalmsley
pushed a commit
that referenced
this pull request
Jun 4, 2021
Fix - Missing Shadow - OSX and Window Position
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.
What does the pull request do?
This fixes what happens when Show or ShowDialog is called.
on osx, the contentview is set after the Window has been resized and before it is actually shown.
this means that OSX is now happy and correctly draws the border / shadow.
I noticed now that windows were showing very quickly with the above fix, that when you show a dialog or window, with CenterScreen or CenterOwner, the window would initially show up at a position and then jump to the correct position.
this must have been introduced by #1714 but not noticable on other platforms and prob had been hidden on osx due to first issue.
So I made sure the window position was set before telling the platform to show the window (in showcore and showdialog)
makes sense, you need to set the window position to set it.
On Win32 when the window is not shown yet, when we tell the backend to resize the window, we get a Resized event and that event causes clientsize to get updated. The window centering code then uses ClientSize to calculate the position of the window in the center of the screen.
On OSX however... when the window is not shown,... no resized event comes and ClientSize remained 0,0 and this means the centering on osx was not working. I fixed this by making the OSX backend raise the resized event when Resize is called and the window hasnt been shown yet.
Both Windows and OSX now behave correctly. Someone will need to test Linux.
How was the solution implemented (if it's not obvious)?
Checklist
Breaking changes
Obsoletions / Deprecations
Fixed issues