Fix GridMap still drawing when Alt+Tabbing

(cherry picked from commit 9fbef6f7db)
This commit is contained in:
kobewi 2021-04-22 01:18:30 +02:00 committed by Rémi Verschelde
parent e05a7a4a4b
commit dac54b6db3
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -1098,6 +1098,16 @@ void GridMapEditor::_notification(int p_what) {
options->set_icon(get_icon("GridMap", "EditorIcons")); options->set_icon(get_icon("GridMap", "EditorIcons"));
search_box->set_right_icon(get_icon("Search", "EditorIcons")); search_box->set_right_icon(get_icon("Search", "EditorIcons"));
} break; } break;
case NOTIFICATION_WM_FOCUS_OUT: {
if (input_action == INPUT_PAINT) {
// Simulate mouse released event to stop drawing when editor focus exists.
Ref<InputEventMouseButton> release;
release.instance();
release->set_button_index(BUTTON_LEFT);
forward_spatial_input_event(nullptr, release);
}
} break;
} }
} }