Fix crash on late mouse enter/exit event arrival.

This commit is contained in:
bruvzg 2023-11-27 08:47:43 +02:00
parent 1ba920fada
commit bf19ced15d
No known key found for this signature in database
GPG Key ID: 7960FCF39844EC38

View File

@ -681,6 +681,9 @@ void Window::_propagate_window_notification(Node *p_node, int p_notification) {
void Window::_event_callback(DisplayServer::WindowEvent p_event) {
switch (p_event) {
case DisplayServer::WINDOW_EVENT_MOUSE_ENTER: {
if (!is_inside_tree()) {
return;
}
Window *root = get_tree()->get_root();
if (root->gui.windowmanager_window_over) {
#ifdef DEV_ENABLED
@ -696,6 +699,9 @@ void Window::_event_callback(DisplayServer::WindowEvent p_event) {
}
} break;
case DisplayServer::WINDOW_EVENT_MOUSE_EXIT: {
if (!is_inside_tree()) {
return;
}
Window *root = get_tree()->get_root();
if (!root->gui.windowmanager_window_over) {
#ifdef DEV_ENABLED