summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-06-17 12:29:13 +0200
committerGitHub <noreply@github.com>2021-06-17 12:29:13 +0200
commitbcd21b29578fd9aa4b69c9e726290de44a072264 (patch)
tree340be4dd0300576cf82050a0c028b5c6052707ff
parentb3e333bcf28c3cc39432e71d53135c20c76f4ad8 (diff)
parent9fbef6f7db4ed8fc1d3767ffb4d856401b5bd339 (diff)
Merge pull request #48070 from KoBeWi/greedmap
Fix GridMap still drawing when Alt+Tabbing
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index 7e17ac2f05..80551de1ba 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -1080,6 +1080,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;
}
}