Repository: godotengine/godot (language: cpp)

Issue:
Editor window does not regain mouse-in-window state when tooltip popup closes via mouse entry [macOS Display Server]
### Tested versions

Reproducible on master as of #103788.
Not reproducible on 4.4 (#100682 shadowed this issue making it not apparent).

### System information

macOS 15.3

### Issue description

Certain interface elements cause a tooltip popup to appear when hovered with the mouse. When the mouse exits the element, the popup disappears.

However, in the case where the mouse exits the element because it entered the tooltip's popup window, the main editor window does not return to a mouse-entered status when the popup disappears.

In this state, the interface does not behave as expected and certain elements cannot be interacted with via mouse.

### Steps to reproduce

1. Open editor
2. Hover the mouse over an element that creates a (non-specialized) tooltip, eg the Output panel button
3. Move the mouse directly onto the tooltip popup

Observe that the editor now believes it is not focused: mousing over interface elements no longer highlights them, and elements such as buttons cannot be clicked.

(In debug builds, a warning is also printed stating: `Entering a window while a window is hovered should never happen in DisplayServer`).

This problematic state can be restored to normal by exiting the mouse and re-entering it into the editor window.

### Minimal reproduction project (MRP)

N/A


Discussion / hints:

Fix patch:
diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm
index dfc42ed0232a..1d41667a0e00 100644
--- a/platform/macos/display_server_macos.mm
+++ b/platform/macos/display_server_macos.mm
@@ -1913,6 +1913,8 @@
 
 	[wd.window_object setContentView:nil];
 	[wd.window_object close];
+
+	mouse_enter_window(get_window_at_screen_position(mouse_get_position()));
 }
 
 void DisplayServerMacOS::window_set_rect_changed_callback(const Callable &p_callable, WindowID p_window) {


Test patch: