Fix GridMap still drawing when Alt+Tabbing

This commit is contained in:
kobewi 2021-04-22 01:18:30 +02:00
parent f6d5b2f3c2
commit 9fbef6f7db

View file

@ -1100,6 +1100,16 @@ void GridMapEditor::_notification(int p_what) {
options->set_icon(get_theme_icon("GridMap", "EditorIcons"));
search_box->set_right_icon(get_theme_icon("Search", "EditorIcons"));
} break;
case NOTIFICATION_APPLICATION_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(MOUSE_BUTTON_LEFT);
forward_spatial_input_event(nullptr, release);
}
} break;
}
}