diff options
author | Kanabenki <18357657+Kanabenki@users.noreply.github.com> | 2018-11-11 11:30:53 +0100 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-12-14 22:58:01 +0100 |
commit | cfb89b672e3d1c52e16771237489c82603148c02 (patch) | |
tree | 348748937a70c19d7b22edd165bd3ebb020938f5 /scene | |
parent | 48fc70e3f70076ff31e4aa4682ff8c4ad8074e14 (diff) |
Prevent FileDialog from stealing focus when setting current file in editor
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/file_dialog.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 1e9f4df4a3..a869f7cfcd 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "file_dialog.h" + #include "core/os/keyboard.h" #include "core/print_string.h" #include "scene/gui/label.h" @@ -596,7 +597,7 @@ void FileDialog::set_current_file(const String &p_file) { int lp = p_file.find_last("."); if (lp != -1) { file->select(0, lp); - if (file->is_inside_tree()) + if (file->is_inside_tree() && !get_tree()->is_node_being_edited(file)) file->grab_focus(); } } |