From f2abdd4dfe2ff80f61d401846763bfd1ed8daf0c Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Wed, 19 Sep 2018 06:38:53 +0200 Subject: [PATCH] Fix touchmenu unhilight optimization (#4236) * Don't optimize away a touchmenu unhighlight when we need it Fix #4234 (Regression after #4189, which, incidentally, gave us a neat way to handle the issue, which was theoretically present well before that ;)). * Bump base Pickup latest changes, just because we can ;). (OpenSSH bump) --- base | 2 +- frontend/ui/widget/touchmenu.lua | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/base b/base index a7e0ab907..746010975 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit a7e0ab9071f03c490f81d6ec395259ee3f94eaf8 +Subproject commit 746010975e7fa7e9a56e510ce5eb32a2d2feaff3 diff --git a/frontend/ui/widget/touchmenu.lua b/frontend/ui/widget/touchmenu.lua index 4b3aaa3cc..43078735c 100644 --- a/frontend/ui/widget/touchmenu.lua +++ b/frontend/ui/widget/touchmenu.lua @@ -152,14 +152,15 @@ function TouchMenuItem:onTapSelect(arg, ges) UIManager:tickAfterNext(function() self.menu:onMenuSelect(self.item) self.item_frame.invert = false - --[[ - -- NOTE: We can optimize that repaint away, every entry in our menu will make at least the menu repaint just after anyways ;). - -- Plus, leaving that unhighlight as "fast" can lead to weird side-effects, depending on devices. - -- If it turns out this need to go back in, consider switching it to "ui". - UIManager:setDirty(self.show_parent, function() - return "fast", self.dimen - end) - --]] + -- NOTE: We can *usually* optimize that repaint away, as most entries in the menu will at least trigger a menu repaint ;). + -- But when stuff doesn't repaint the menu and keeps it open, we need to do it. + -- Since it's an *un*highlight containing text, we make it "ui" and not "fast", both so it won't mangle text, + -- and because "fast" can have some weird side-effects on some devices in this specific instance... + if self.item.hold_keep_menu_open or self.item.keep_menu_open then + UIManager:setDirty(self.show_parent, function() + return "ui", self.dimen + end) + end end) end return true