added support for special media buttons on Amazon Fire TV remote control
[rocksndiamonds.git] / src / libgame / gadgets.c
index 736f1465fb2d381b5a07419f4f28759ff55de656..6b7d2592f435849b3bd8fb0f8798227278a18ca7 100644 (file)
@@ -1709,7 +1709,8 @@ boolean HandleGadgets(int mx, int my, int button)
       if (gi->textinput.cursor_position != old_cursor_position)
        DrawGadget(gi, DG_PRESSED, gi->direct_draw);
 
-      StartTextInput(gi->x, gi->y);
+      if (press_event)
+       StartTextInput(gi->x, gi->y, gi->width, gi->height);
     }
     else if (gi->type & GD_TYPE_TEXT_AREA && button != 0 && !motion_status)
     {
@@ -1725,7 +1726,8 @@ boolean HandleGadgets(int mx, int my, int button)
       if (gi->textarea.cursor_position != old_cursor_position)
        DrawGadget(gi, DG_PRESSED, gi->direct_draw);
 
-      StartTextInput(gi->x, gi->y);
+      if (press_event)
+       StartTextInput(gi->x, gi->y, gi->width, gi->height);
     }
     else if (gi->type & GD_TYPE_SELECTBOX && gi->selectbox.open &&
             !keep_selectbox_open)
@@ -1756,7 +1758,7 @@ boolean HandleGadgets(int mx, int my, int button)
       new_gi->event.type = GD_EVENT_INFO_ENTERING;
       new_gi->callback_info(new_gi);
     }
-    else if (last_info_gi != NULL)
+    else if (last_info_gi != NULL && last_info_gi->mapped)
     {
       last_info_gi->event.type = GD_EVENT_INFO_LEAVING;
       last_info_gi->callback_info(last_info_gi);