diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a47b108b43..9b0e943929d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,10 +8,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added -- Support for sandbox applications ([#2178](https://github.com/lbryio/lbry-desktop/pull/2178)) +- Support for sandbox games and applications ([#2178](https://github.com/lbryio/lbry-desktop/pull/2178)) - CTA to invite page on first run ([#2221](https://github.com/lbryio/lbry-desktop/pull/2221)) - Responsive related content list ([#2226](https://github.com/lbryio/lbry-desktop/pull/2226)) - Autoplay content in list of related files ([#2235](https://github.com/lbryio/lbry-desktop/pull/2235)) +- Support for back/forward mouse navigation on Windows ([#2250](https://github.com/lbryio/lbry-desktop/pull/2250)) ### Changed diff --git a/src/main/createWindow.js b/src/main/createWindow.js index b26ada7e0ed..ff4f5e76b7d 100644 --- a/src/main/createWindow.js +++ b/src/main/createWindow.js @@ -73,6 +73,19 @@ export default appState => { setupBarMenu(); + // Windows back/forward mouse navigation + window.on('app-command', (e, cmd) => { + switch (cmd) { + case 'browser-backward': + window.webContents.send('navigate-backward', null); + break; + case 'browser-forward': + window.webContents.send('navigate-forward', null); + break; + default: // Do nothing + } + }); + window.on('close', event => { if (!appState.isQuitting && !appState.autoUpdateAccepted) { event.preventDefault(); diff --git a/src/renderer/index.js b/src/renderer/index.js index 0d684743891..0f4b8d98f83 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -18,7 +18,7 @@ import { doHideModal, } from 'redux/actions/app'; import { doToast, doBlackListedOutpointsSubscribe, isURIValid, setSearchApi } from 'lbry-redux'; -import { doNavigate } from 'redux/actions/navigation'; +import { doNavigate, doHistoryBack, doHistoryForward } from 'redux/actions/navigation'; import { doDownloadLanguages, doUpdateIsNightAsync } from 'redux/actions/settings'; import { doAuthenticate, Lbryio, rewards } from 'lbryinc'; import 'scss/all.scss'; @@ -41,6 +41,14 @@ if (process.env.SEARCH_API_URL) { setSearchApi(process.env.SEARCH_API_URL); } +ipcRenderer.on('navigate-backward', () => { + app.store.dispatch(doHistoryBack()); +}); + +ipcRenderer.on('navigate-forward', () => { + app.store.dispatch(doHistoryForward()); +}); + // We need to override Lbryio for getting/setting the authToken // We interect with ipcRenderer to get the auth key from a users keyring // We keep a local variable for authToken beacuse `ipcRenderer.send` does not