mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user