Open MCMicS opened 2 years ago
Hey @MCMicS I didnt understood the issue. The window is saving the scaled size and when you reopen it the window gets bigger? I don't have a high DPI monitor to test with Windows. Please provide some screenshots or a little video/gif.
Yes it will increase. if you close the app and reopen it the size will be bigger.
a high dpi should not needed. It should also happen if set you scale in WIndows (https://www.windowscentral.com/how-set-custom-display-scaling-setting-windows-10)
I try to provide an gif later the day
see attached video: https://user-images.githubusercontent.com/4604206/161988891-cf239449-a73c-4d9b-a029-b8cd20ae7060.mp4
@MCMicS could you test it with the latest version? For me it doesn't happens anymore. I think that was an Electron bug. I will close it, if it happens yet, tell me and we can open again.
With version 3.8.12 it still occurs.
And yes it is an electron issue or rather an issue of the time when the window bound are restored.
I cant reproduce it on my Windows 10. Did you have this problem on another machine? I couldn't see how this could happen just on one machine. Its very weird.
I have tested on another machine with different environment. The problem still occurs but in some strange behaviour. It is needed to use two monitors. Environment 1:
Environment :
*Conclusion It seem that the primary display will be used to restore the last stored window bounds. Then the window will moved to the last position on second screen and afterwards the size will adapted to the dpi of the current display.
I also created an internal application based on Electron who had this issue. My solution the days before the electron fix was provided was to call setSize
after initialization of the BrowserWindow. But I have not check now if it the issue was completely solved (now I'm using Electron 20.x). B
My Setup
Description
Current Behavior
The Window size is scaled with the factor.
Expected Behavior
The window has same size as before quit the application.
This is because following change with 17.2.0: https://github.com/electron/electron/blob/17-x-y/patches/chromium/set_dpi_correctly_during_main_window_creation.patch#L36
One workaround is to set the
setSize
after initialization of theBrowserWindow
like: