Repository navigation
fix: handle WM_GETMINMAXINFO instead of letting chromium do it - #19928
Conversation
|
Thank you @brenca for the PR -- it will likely fix my issue: whyboris/Video-Hub-App#260 🙇 |
|
@ckerr thanks for the quick review! I realized that removing the workaround does re-introduce a bug, so I changed the code to address that bug and still fix the issues mentioned above. I'll do some additional testing to make sure things work alright. |
032073f to
256da70
Compare
|
@ckerr I added some explanatory comments and made some changes, can I get another review from you? |
|
Release Notes Persisted
|
|
I was unable to backport this PR to "6-0-x" cleanly; |
|
I was unable to backport this PR to "7-0-x" cleanly; |
* fix: remove WM_GETMINMAXINFO workaround since it's no longer needed * fix: handle WM_GETMINMAXINFO ourselves * fix: remove part of the chromium WM_GETMINMAXINFO handler
* fix: remove WM_GETMINMAXINFO workaround since it's no longer needed * fix: handle WM_GETMINMAXINFO ourselves * fix: remove part of the chromium WM_GETMINMAXINFO handler
|
A maintainer has manually backported this PR to "6-0-x", please check out #20001 |
… (#20000) * fix: remove WM_GETMINMAXINFO workaround since it's no longer needed * fix: handle WM_GETMINMAXINFO ourselves * fix: remove part of the chromium WM_GETMINMAXINFO handler
… (#20001) * fix: remove WM_GETMINMAXINFO workaround since it's no longer needed * fix: handle WM_GETMINMAXINFO ourselves * fix: remove part of the chromium WM_GETMINMAXINFO handler
|
Thank you @brenca for working on this bugfix 🙇
|
|
False alarm -- seems like this PR has not been merged into ❤️ Thank you @brenca, the Electron team, and all those who help with it 🙇 |
|
@codebytere this PR is causing issues for us on Electron 6 and 7. When we call setBounds on a hidden window, and then show that window on a monitor with a different display scale than the primary....it's the wrong size. But Electron thinks it's the correct size. We've narrowed it down to this PR causing the bad behavior. The reason we do this is that we have menus that are hidden, and change size based on the contents within the menus. So this bug makes our app look awful in the latest electron versions. I've reached out to @brenca on slack to see if he has any ideas of how to fix this. It's presently preventing us from keeping up with the latest electron release. |
After some testing, I found that I can only reproduce when resizable is false. I'm working on a reproducer. |
Description of Change
There is a workaround I introduced that's no longer needed and is causing bugs, so this PR removes that. We had that workaround because during the
WM_GETMINMAXINFOmessage Windows reports a position that's incorrect (somewhere around -32000 for both coordinates), and the handler in chromium calculates the scale factor for the window based on that position, which will be incorrect if you have more than one monitor (the leftmost will be used).To work around this, we instead handle the
WM_GETMINMAXINFOmessage ourselves, similarly to how chromium does it, but without a size compensation that's not required for us (it compensates for the window frame size, but we expect the minimum and maximum sizes to apply to the window anyway by default, and that compensation code is from 2011, doesn't care about scale factors, and probably should be removed/corrected in chromium anyway).I'm going to look into upstreaming this new workaround/fix so that we can later remove it altogether.
Depends on #19886.
Fixes #19423.
Fixes #19816.
Checklist
npm testpassesRelease Notes
Notes: Fixed a bug where windows would sometimes shrink to 0 size after being restored on Windows.