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?
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?
Share Improve this question edited Aug 9, 2018 at 15:11 user1234 asked Aug 9, 2018 at 15:07 user1234user1234 8,9784 gold badges30 silver badges37 bronze badges1 Answer
Reset to default 22There is a .center()
method on BrowserWindow
, so
const win = remote.getCurrentWindow();
win.setSize(width, height);
win.center();
centers the window after resizing.