electron/electron

BrowserWindow.on('swipe') broken since Electron 3

Closed this issue · 7 comments

Issue Details

  • Electron Version:
    • 3.0.x, 4.0.x, 5.0.x, 6.0.x
  • Operating System:
    • macOS 10.14.5
  • Last Known Working Electron version:
    • 2.0.x

Expected Behavior

BrowserWindow.on('swipe') fires when doing a 3-finger swipe gesture.

Actual Behavior

BrowserWindow.on('swipe') does not fire.

@codebytere @deepak1556 this seems to have caused a regression in VSCode where our window size is assumed to be larger than it is when macOS native tabs are enabled. See microsoft/vscode#79176

Swipe event still isn't triggered with electron 7, news ?

In addition to 'rotate-gesture'. Still not working in 8.1.1

@sdnyco rotate-gesture is working just fine for me, see this fiddle.

@KASOGIT it does work: it's your system settings that make it appear not to.

-swipeWithEvent: is used to implement 10.6-style trackpad swiping, where the content on the screen doesn't move with the swipe. Most macOS trackpads are not configured to allow this kind of swiping anymore; the "Swipe between pages" preference in Trackpad pref pane has to be set to "swipe with two or three fingers" for it to be available.

Screen Shot 2020-04-14 at 5 40 47 PM

i wanted to prevent three figure swipe gesture i tried

`win.on("swipe", (e, d) => {
log.info("Swipe")
// e.preventDefault()

})
win.on("rotate-gesture", (e, r) => {
log.info("rotate-gesture")
// e.preventDefault()
})`

but i am not even getting logs. it seems both event not working.
please let me know if anyone have any solution.