From 6def0bb7f0529f2c930afff66fefa0b800125be0 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Fri, 16 Apr 2021 01:06:00 +0200 Subject: [PATCH] FrontLight: Workaround potential crashes when swiping the frontlight bar. This whole widget is a mess. --- frontend/ui/widget/frontlightwidget.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/ui/widget/frontlightwidget.lua b/frontend/ui/widget/frontlightwidget.lua index 2f166d284..5fd241670 100644 --- a/frontend/ui/widget/frontlightwidget.lua +++ b/frontend/ui/widget/frontlightwidget.lua @@ -627,6 +627,12 @@ function FrontLightWidget:naturalLightConfigClose() end function FrontLightWidget:onTapProgress(arg, ges_ev) + -- The throttling has a tendency to wreak a bit of a havoc, + -- so, if the widget hasn't been repainted yet, go away. + if not self.fl_group.dimen or not self.light_frame.dimen then + return true + end + if ges_ev.pos:intersectWith(self.fl_group.dimen) then -- Unschedule any pending updates. UIManager:unschedule(self.update)