Repository navigation
Fix calculating min/max size in frameless view - #2979
Merged
zcbenz merged 3 commits intoOct 5, 2015
Merged
Conversation
Update from original
The minimum and maximum size that frameless windows had used, was incorrect. It included the border, so when it was called it actually added that to the size, so window increased in size. The fix makes sure that the view will use the frameless size. This fixes electron#2945 and partially fixes electron#1806 (it also refers to some other issues with hidpi which might still exist).
Contributor
|
The way Linux implements frameless window is quite different from Windows, so I think we should only use this code on Windows. |
Limiting the solution to Windows only.
Contributor
Author
|
I changed it to work on Windows only. The issue also exists on OS X (as mentioned in #2945 and #1806). I believe the solution will be similar (normalizing the min/max size using By the way, the fix works for windows with or without a frame/border. |
Contributor
|
👍 |
zcbenz
added a commit
that referenced
this pull request
Oct 5, 2015
…less Fix calculating min/max size in frameless view
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.
The minimum size and maximum size that frameless view used, were incorrect. The sizes are treated as if they don't include border, but they did so it actually increased the window size on resize (see the reproduction code in #2945). The fix was to normalize the sizes from window size to frameless size (removing border etc.).
This resolves #2945.
It also partially fixes #1806. The reason I say partially is because the issue also mention some issues with hidpi, and I'm not sure if this fixes that as well.Edit: It also resolves #1806. At first I wasn't sure it also solved the second issue mentioned there about resizing when in hidpi doubling window size, but I manged to test it using
--force-device-scale-factor=2and it seems to have solve it.This code was only tested on Windows. If it doesn't work on Linux or OS X, we can easily make it work only for Windows by moving the code from
frameless_view.cctowin_frame_view.cc.