diff --git a/frontend/ui/gesturedetector.lua b/frontend/ui/gesturedetector.lua index 2b6ae0f10..a84aa5181 100644 --- a/frontend/ui/gesturedetector.lua +++ b/frontend/ui/gesturedetector.lua @@ -596,7 +596,7 @@ function GestureDetector:holdState(tev, hold) } else local ges_ev = self:handlePan(tev) - ges_ev.ges = "hold_pan" + if ges_ev ~= nil then ges_ev.ges = "hold_pan" end return ges_ev end end diff --git a/frontend/ui/reader/readerfrontlight.lua b/frontend/ui/reader/readerfrontlight.lua index 3477da146..84774eae4 100644 --- a/frontend/ui/reader/readerfrontlight.lua +++ b/frontend/ui/reader/readerfrontlight.lua @@ -32,7 +32,7 @@ end function ReaderFrontLight:onAdjust(arg, ges) if self.lipc_handle and self.intensity ~=nil then local rel_proportion = ges.distance / Screen:getWidth() - local delta_int = self.steps[math.ceil(#self.steps*rel_proportion)] + local delta_int = self.steps[math.ceil(#self.steps*rel_proportion)] or self.steps[#self.steps] local msg = "" if ges.direction == "north" then msg = _("Increase front light intensity to ") @@ -51,6 +51,7 @@ function ReaderFrontLight:setIntensity(intensity, msg) if self.lipc_handle then intensity = intensity < 0 and 0 or intensity intensity = intensity > 24 and 24 or intensity + self.intensity = intensity self.lipc_handle:set_int_property("com.lab126.powerd", "flIntensity", intensity) UIManager:show(Notification:new{ text = msg..intensity,