workaround of width get bigger after restore from minmized

This commit is contained in:
Xen 2020-05-19 22:11:42 +08:00
parent 9fea4d660f
commit 1ee5757266
1 changed files with 7 additions and 0 deletions

View File

@ -59,6 +59,13 @@ const createWindow = () => {
mainWindow = null;
});
mainWindow.on("restore", () => {
mainWindow.setSize(
store.get("window.width", widthDefault),
store.get("window.height", heightDefault)
);
});
Shortcut.register(mainWindow, "CmdOrCtrl+X", () => {
console.log("You pressed cmd/ctrl x");
mainWindow.webContents.send("main-cmd", "Clear");