summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2021-04-22 01:18:30 +0200
committerkobewi <kobewi4e@gmail.com>2021-04-22 01:18:30 +0200
commit9fbef6f7db4ed8fc1d3767ffb4d856401b5bd339 (patch)
tree2e440d9f6ece128f10c65e6f0a6f88c5ba10772d
parentf6d5b2f3c242f08af835891caff32ed6342290a9 (diff)
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 74ae45a46e..4b241aa9a7 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -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;
}
}