Stop drag actions in the TileMapLayer and GridMap editors when focus is lost

This commit is contained in:
Michael Alexsander 2026-03-03 16:10:11 -03:00
parent 778cf54dab
commit bbacc674b8
No known key found for this signature in database
GPG key ID: A9C91EE110F4EABA
2 changed files with 10 additions and 2 deletions

View file

@ -3742,6 +3742,14 @@ void TileMapLayerEditor::_notification(int p_what) {
toggle_highlight_selected_layer_button->set_pressed_no_signal(EDITOR_GET("editors/tiles_editor/highlight_selected_layer"));
}
} break;
case NOTIFICATION_APPLICATION_FOCUS_OUT: {
// Simulate mouse released event to stop drawing when editor focus exits.
Ref<InputEventMouseButton> release;
release.instantiate();
release->set_button_index(MouseButton::LEFT);
forward_canvas_gui_input(release);
} break;
}
}

View file

@ -1334,8 +1334,8 @@ void GridMapEditor::_notification(int p_what) {
} break;
case NOTIFICATION_APPLICATION_FOCUS_OUT: {
if (input_action == INPUT_PAINT) {
// Simulate mouse released event to stop drawing when editor focus exists.
if (input_action == INPUT_PAINT || input_action == INPUT_ERASE || input_action == INPUT_SELECT) {
// Simulate mouse released event to stop drawing when editor focus exits.
Ref<InputEventMouseButton> release;
release.instantiate();
release->set_button_index(MouseButton::LEFT);