electron: Windows 10 Browser Window Bounds Calculating Incorrectly
The Browser Window width
and x
coordinates are being calculated incorrectly in Windows 10 (Windows 8.1 did not have this problem). Here you can see that the getBounds()
function is showing that my x
value is 0 but the desktop background is showing through. I’m guessing this may have something to do with a subtle shadow that each window in Windows 10 is now casting.
Not sure how to fix this, but would be nice to resolve as I have some window state management code written to pin windows in the correct location, and now they are not properly being positioned.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 8
- Comments: 29 (14 by maintainers)
Ignore the bug report for 4 years – TEN major releases – and then close it due to it being reported against an unsupported version. “Brilliant” way to manage issue lists getting long.
I disabled my apps’ features of remembering window size and position, as a temporary workaround to this problem. (Not really a workaround.) For a while I tested this problem on every major update, and was one of the people who confirmed it was still present, for a while, delaying that feature while I hoped an update might include a fix. I stopped retesting it after many major releases did not include any fix, or any sign of interest by Electron folks. Apparently, for those updates where I did retest it, I was wasting my time.
This is very discouraging, if not infuriating. And unfortunately this kind of policy will only damage code quality, especially as developers such as myself, see this as a clear reason to halt efforts to try to narrow down Electron bugs, to take the time to reproduce the problems and file bug reports against Electron, and instead begin the process of finding and migrating to different solutions to cross-platform development needs.
The Electron version reported on this issue is no longer supported. See our supported versions documentation.
If this is still reproducible on a supported version, please open a new issue with any other new information that a maintainer should know.
Thank you for taking the time to report this issue and helping to make Electron better! Your help is appreciated.
@sofianguy It’s still an issue with Electron 4/5 and latest win 10, please reopen.
Perhaps, @kirkouimet could you confirm this as fixed in 1.6.7+?
Well that’s an annoying bot. Could at least ask if it is still an issue and then update the label.
In my case I’m opening new child window alongside the right border of the parent window to fill the empty screen space. Right now my code looks like this. Looks hacky but works okay (Electron v9.1.0). Hope it helps:
@zcbenz @MarshallOfSound this is affecting high profile apps like Discord, any chance someone could look into it?
Is there an update on when this might be addressed or what the best workaround is?
Can repro with Electron 8
@kevinsawicki and @bsclifton this is still an issue as of Electron 1.8.2 on Windows 10 updated October 2017
Was this fixed with https://github.com/electron/electron/pull/9167 ?
Windows 10 has a thinner frame than before, and in order to be compatible with existing apps it is returning wrong values in its win32 APIs. You can reproduce the same problem in Chrome browser:
I have reported the problem to upstream: https://crbug.com/576192.