After calling
remote.getCurrentWindow().setSize(width, height);
the window resizes, but is not positioned in the center of the screen. Is there a way to adjust the offset of the window relative to the screen?
There is a .center()
method on BrowserWindow
, so
const win = remote.getCurrentWindow();
win.setSize(width, height);
win.center();
centers the window after resizing.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.