Repository: godotengine/godot (language: cpp)

Issue:
Open an in-editor menu requires an extra click
### Tested versions

- Reproducible in 4.4dev [4cf02312f6674083c5a628b4701643e1157c85f0]
- Not reproducible in 4.4dev 7

### System information

Windows 11

### Issue description

I've detected that in-editor menu now requires an extra click:

![Image](https://github.com/user-attachments/assets/3213e96a-0283-455f-bb8e-13a8807b7efb)

Seems like a recent regression.

### Steps to reproduce

^^

### Minimal reproduction project (MRP)

N/A


Discussion / hints:
Also, drop-down lists seems affected by this bug too: ![Image](https://github.com/user-attachments/assets/93463da3-7c23-4327-93af-109addef10ed)

I can reproduce it on Linux too. I'll bisect.
My laptop literally died on the last step of bisecting this, but it's 99% sure to be #81532. I was afraid that such a button change might have unforeseen regressions, as they always do

CC @wlsnmrk @KoBeWi @Hilderin 

Fix patch:
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index d69ab4c9cb87..1502579a6a36 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -151,11 +151,13 @@ void BaseButton::_toggled(bool p_pressed) {
 void BaseButton::on_action_event(Ref<InputEvent> p_event) {
 	Ref<InputEventMouseButton> mouse_button = p_event;
 
-	if (!status.pressed_down_with_focus && p_event->is_pressed() && (mouse_button.is_null() || status.hovering)) {
+	if (p_event->is_pressed() && (mouse_button.is_null() || status.hovering)) {
 		status.press_attempt = true;
 		status.pressing_inside = true;
-		status.pressed_down_with_focus = true;
-		emit_signal(SNAME("button_down"));
+		if (!status.pressed_down_with_focus) {
+			status.pressed_down_with_focus = true;
+			emit_signal(SNAME("button_down"));
+		}
 	}
 
 	if (status.press_attempt && status.pressing_inside) {
@@ -181,11 +183,13 @@ void BaseButton::on_action_event(Ref<InputEvent> p_event) {
 		}
 	}
 
-	if (status.pressed_down_with_focus && !p_event->is_pressed()) {
+	if (!p_event->is_pressed()) {
 		status.press_attempt = false;
 		status.pressing_inside = false;
-		status.pressed_down_with_focus = false;
-		emit_signal(SNAME("button_up"));
+		if (status.pressed_down_with_focus) {
+			status.pressed_down_with_focus = false;
+			emit_signal(SNAME("button_up"));
+		}
 	}
 
 	queue_redraw();


Test patch: