Skip to content

Commit

Permalink
fix mouse back/forward triggering twice on linux (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
timche authored Feb 16, 2022
1 parent afb0d83 commit afd2aa9
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/main/main-window/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import * as path from 'path'
import { app, BrowserWindow, nativeTheme, ipcMain } from 'electron'
import { is } from 'electron-util'
import { getSelectedAccount } from '../accounts'
import config, { ConfigKey } from '../config'
import { toggleAppVisiblityTrayItem } from '../tray'
import {
getAccountView,
getSelectedAccountView,
updateAllAccountViewBounds
} from '../account-views'
Expand Down Expand Up @@ -91,25 +89,6 @@ export function createMainWindow(): void {

mainWindow.loadFile(path.resolve(__dirname, indexHTML))

mainWindow.on('app-command', (_event, command) => {
const selectedAccount = getSelectedAccount()

if (!selectedAccount) {
return
}

const accountView = getAccountView(selectedAccount.id)

if (command === 'browser-backward' && accountView.webContents.canGoBack()) {
accountView.webContents.goBack()
} else if (
command === 'browser-forward' &&
accountView.webContents.canGoForward()
) {
accountView.webContents.goForward()
}
})

mainWindow.on('close', (event) => {
// Workaround: Closing the main window when on full screen leaves a black screen
// https://github.com/electron/electron/issues/20263
Expand Down

0 comments on commit afd2aa9

Please sign in to comment.