Skip to content

Commit

Permalink
Merge pull request #938 from townmi/fix-window-rect
Browse files Browse the repository at this point in the history
fix(window-unmaximize): fix windows unmaximize drag
  • Loading branch information
ipy authored Sep 9, 2019
2 parents 7b15313 + 1b1c202 commit 6b26eed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ function createMainWindow(openDialog, playlistId) {
['left-drag', 'left-up'].forEach((channel) => {
mouse.on(channel, (...args) => {
if (!mainWindow || mainWindow.webContents.isDestroyed()) return;
if (mainWindow.isMaximized()) return;
mainWindow.webContents.send(`mouse-${channel}`, ...args);
});
});
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/components/Titlebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ export default {
this.$event.emit('side-bar-mouseup');
},
handleDbClick() {
if (!this.isMaximized) {
const browserWindow = this.$electron.remote.getCurrentWindow();
if (!browserWindow.isMaximized()) {
this.$electron.ipcRenderer.send('callMainWindowMethod', 'maximize');
} else {
this.$electron.ipcRenderer.send('callMainWindowMethod', 'unmaximize');
Expand Down

0 comments on commit 6b26eed

Please sign in to comment.