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: compensate for title bar height when setting bounds on BrowserView
#34713
Conversation
520c5a8
to
77fb010
Compare
77fb010
to
05f4a77
Compare
05f4a77
to
7f13a44
Compare
03a0d03
to
16f8d96
Compare
16f8d96
to
c8c8797
Compare
Failure:
is woa-only and not possible affected by this macOS-only change. merging. |
Release Notes Persisted
|
I have automatically backported this PR to "18-x-y", please check out #35493 |
I have automatically backported this PR to "19-x-y", please check out #35495 |
/trop run backport-to 12-x-y |
The backport process for this PR has been manually initiated - sending your PR to |
I have automatically backported this PR to "12-x-y", please check out #35501 |
/trop run backport-to 21-x-y |
The backport process for this PR has been manually initiated - sending your PR to |
I have automatically backported this PR to "21-x-y", please check out #35502 |
So we need to manually add 28 to y when using framed window? And only do this in mac? |
@linonetwo no - you should not need to change your existing calculations, unless you for some reason want your BrowserViews cut off inescapably. |
Then this is strange, after upgrade from to 18.2.0 to 20.1.1 , I found browserView move up 28px, so I have to minus 28 from y to compensate this: But never mind, I found this workaround works. You can wait for other user's report to check if this is really a bug in electron side, or just my fault that I didn't realized yet. |
I'm also seeing the same issue.
issue might be due to the title bar height being added to the y coordinate
instead of reducing it from the view's height
|
…iew` (electron#34713) fix: compensate for title bar height when setting bounds
Description of Change
Closes #32880.
Fixes an issue where part of the BrowserView could be cut off when calling
setBounds
on some windows. This was happening because we were not taking the titlebar height into account when callingsetBounds
on a framed window, which meant that the y-value for the bounds would end up negative. For example, the following snippet:main.js
Would result in the
y
value being calculated to -28, which is the height of the titlebar. Fix the problem by correcting for this extra height when relevant.Visual Comparison:
Before
After
Frameless Window
ComparisonChecklist
npm test
passesRelease Notes
Notes: Fixed an issue where part of the BrowserView could be cut off when calling
setBounds
on some windows.