TouchMenu: Abort early if tap/hold handlers are called on an unpainted

widget

May happen if we have blocking stuff on startup (e.g., Wi-Fi), and you
spam tap the screen during the white screen.
reviewable/pr7876/r1
NiLuJe 3 years ago
parent c7232af8eb
commit 240a4acdcc

@ -157,6 +157,9 @@ function TouchMenuItem:onTapSelect(arg, ges)
end
if enabled == false then return end
-- If the menu hasn't actually been drawn yet, don't do anything (as it's confusing, and the coordinates may be wrong).
if not self.item_frame.dimen then return end
if G_reader_settings:isFalse("flash_ui") then
self.menu:onMenuSelect(self.item)
else
@ -200,6 +203,8 @@ function TouchMenuItem:onHoldSelect(arg, ges)
end
if enabled == false then return end
if not self.item_frame.dimen then return end
if G_reader_settings:isFalse("flash_ui") then
self.menu:onMenuHold(self.item, self.text_truncated)
else

Loading…
Cancel
Save