added showing overlay touch buttons only if touch screen is really used
[rocksndiamonds.git] / src / libgame / gadgets.c
index 1004199f40d45bdd9cf405ca4398a71f1e75d045..c50fb32e5f0f1e3b9b8493957470499b1ed8c86a 100644 (file)
@@ -808,7 +808,8 @@ static void DrawGadget_OverlayTouchButton(struct GadgetInfo *gi)
   int alpha_max = SDL_ALPHA_OPAQUE;
   int alpha_step = ALPHA_FADING_STEPSIZE(alpha_max);
 
-  if (gi->mapped)
+  // only show mapped overlay touch buttons if touch screen is really used
+  if (gi->mapped && runtime.uses_touch_device)
   {
     if (alpha < alpha_max)
       alpha = MIN(alpha + alpha_step, alpha_max);