From 1651b494b33800344452c3e88fa54412063393ab Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 20 Apr 2020 23:23:55 +0200 Subject: [PATCH] fixed bug with invisible, but active overlay touch buttons This fixes a nasty bug with handling (invisible) overlay touch buttons on devices without touch screen. --- src/libgame/gadgets.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index b30082a2..cbe1cabc 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -1479,6 +1479,10 @@ static void MapGadgetExt(struct GadgetInfo *gi, boolean redraw) if (gi == NULL || gi->deactivated || gi->mapped) return; + // do not map overlay touch buttons if touch screen is not used + if (gi->overlay_touch_button && !runtime.uses_touch_device) + return; + gi->mapped = TRUE; if (redraw) -- 2.34.1