You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configuration:
Windows 10
2 monitors, side-by-side configuration.
Left monitor scaling set to 150%.
Right monitor scaling set to 200%.
Left monitor is primary display.
(other scale factors should produce the same results, as long as the two displays have different scale factors)
Steps to reproduce:
open electron application, move to any location on the right monitor.
close & re-open application
Problem description:
The X & Y location of the software is preserved correctly. However, the width and height of the application is now larger than it was when closed. The width and height were both scaled up by 33%.
Expected behavior:
The width and height are restored correctly.
This seems like a per-display scaling awareness problem, but I'm not sure if it's an issue with electron-window-state, or with the electron BrowserWindow constructor width & height arguments. It does seem likely however that the problem could be corrected in electron-window-state.
The text was updated successfully, but these errors were encountered:
Adding this line after constructing the window seemed to result in the correct window size for me:
window.setBounds(mainWindowState);
All this does is re-apply the stored size after the window has already been placed on the correct monitor, which somehow results in the scale applying correctly.
@Marcus10110 I reckon your hunch about it being a bug with the BrowserWindow constructor is correct, though I'm less certain how electron-window-state could reliably fix this on its own. Perhaps the size could be re-applied when mainWindowState.manage() is called...
EDIT: may need some more safety for the mainWindowState first time through, as x and y can be undefined (even though the types indicate otherwise).
Configuration:
Windows 10
2 monitors, side-by-side configuration.
Left monitor scaling set to 150%.
Right monitor scaling set to 200%.
Left monitor is primary display.
(other scale factors should produce the same results, as long as the two displays have different scale factors)
Steps to reproduce:
Problem description:
The X & Y location of the software is preserved correctly. However, the width and height of the application is now larger than it was when closed. The width and height were both scaled up by 33%.
Expected behavior:
The width and height are restored correctly.
This seems like a per-display scaling awareness problem, but I'm not sure if it's an issue with electron-window-state, or with the electron BrowserWindow constructor width & height arguments. It does seem likely however that the problem could be corrected in electron-window-state.
The text was updated successfully, but these errors were encountered: