Skip to content

Commit 60c2e1e

Browse files
committed
Merge pull request #118542 from shiena/fix/118517
Fix BaseButton popup unresponsive on touchscreen after first tap
2 parents 9fc8f0e + 3b75aa0 commit 60c2e1e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scene/gui/base_button.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void BaseButton::gui_input(const Ref<InputEvent> &p_event) {
6767
return;
6868
}
6969

70-
if (p_event->is_pressed()) {
70+
if (p_event->is_pressed() && status.touch_index == -1) {
7171
status.device_id = p_event->get_device();
7272
}
7373

@@ -267,6 +267,7 @@ void BaseButton::on_action_event(Ref<InputEvent> p_event) {
267267
if (action_mode == ACTION_MODE_BUTTON_PRESS) {
268268
status.press_attempt = false;
269269
status.pressing_inside = false;
270+
status.touch_index = -1; // Action completed, release matching touch so later taps aren't dropped if a modal consumes the release.
270271
}
271272
status.pressed = !status.pressed;
272273
_unpress_group();

0 commit comments

Comments
 (0)