[fix, SDL] Time: fix crash when scrolling in continuous mode (#9314)

Introduced with #8999.

Fixes #9311.
pull/9316/head
zwim 2 years ago committed by GitHub
parent 7366a031d6
commit 22fe3933c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -349,7 +349,7 @@ function ReaderPaging:onSwipe(_, ges)
-- We did some panning but released after a short amount of time,
-- so this gesture ended up being a Swipe - and this swipe was
-- not handled by the other modules (so, not opening the menus).
-- Do as :onPanRelese() and ignore this swipe.
-- Do as :onPanRelease() and ignore this swipe.
self:onPanRelease() -- no arg, so we know there we come from here
return true
else

@ -3,6 +3,7 @@ local Generic = require("device/generic/device")
local SDL = require("ffi/SDL2_0")
local ffi = require("ffi")
local logger = require("logger")
local time = require("ui/time")
-- SDL computes WM_CLASS on X11/Wayland based on process's binary name.
-- Some desktop environments rely on WM_CLASS to name the app and/or to assign the proper icon.
@ -212,7 +213,7 @@ function Device:init()
y = 100*scrolled_y,
},
pos = pos,
time = ev.time,
time = time.timeval(ev.time),
mousewheel_direction = scrolled_y,
}
local fake_ges_release = {
@ -220,7 +221,7 @@ function Device:init()
distance = fake_ges.distance,
relative = fake_ges.relative,
pos = pos,
time = ev.time,
time = time.timeval(ev.time),
from_mousewheel = true,
}
local fake_pan_ev = Event:new("Pan", nil, fake_ges)

Loading…
Cancel
Save