Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #922 from gergelypolonkai/linux-mouse-navigation
Browse files Browse the repository at this point in the history
Make it possible to navigate with mouse forward/back buttons in Linux
  • Loading branch information
christianbundy committed Jan 17, 2019
2 parents 5f96457 + b75d6e4 commit 756c8c5
Show file tree
Hide file tree
Showing 3 changed files with 159 additions and 90 deletions.
12 changes: 12 additions & 0 deletions main-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var ref = require('ssb-ref')
var setupContextMenuAndSpellCheck = require('./lib/context-menu-and-spellcheck')
var watch = require('mutant/watch')
var requireStyle = require('require-style')
var mouseForwardBack = require('mouse-forward-back')

module.exports = function (config) {
var sockets = combine(
Expand Down Expand Up @@ -85,6 +86,17 @@ module.exports = function (config) {
electron.ipcRenderer.on('goForward', views.goForward)
electron.ipcRenderer.on('goBack', views.goBack)

if (mouseForwardBack) {
mouseForwardBack.register((direction) => {
if (direction === 'back') {
views.goBack()
} else if (direction === 'forward') {
views.goForward()
}
},
electron.remote.getCurrentWindow().getNativeWindowHandle())
}

document.head.appendChild(
h('style', {
innerHTML: computed(api.settings.obs.get('patchwork.theme', 'light'), themeName => {
Expand Down
Loading

0 comments on commit 756c8c5

Please sign in to comment.