summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-07-01 00:25:10 +0200
committerkobewi <kobewi4e@gmail.com>2022-07-01 00:25:10 +0200
commit8d62b736b2fceb60a76ff916c8f904e25fece832 (patch)
treef452583b52c54b4764127ba3cdbe3274b433f2b1 /scene
parent0800d475a41afc9716e115c1b44ba38b7ec46268 (diff)
Fix find_next_valid_focus() freeze
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/control.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index b7b0571c07..6e2db68db0 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -2422,7 +2422,7 @@ Control *Control::find_next_valid_focus() const {
}
}
- if (next_child == from) { // No next control.
+ if (next_child == from || next_child == this) { // No next control.
return (get_focus_mode() == FOCUS_ALL) ? next_child : nullptr;
}
if (next_child) {
@@ -2506,7 +2506,7 @@ Control *Control::find_prev_valid_focus() const {
}
}
- if (prev_child == from) { // No prev control.
+ if (prev_child == from || prev_child == this) { // No prev control.
return (get_focus_mode() == FOCUS_ALL) ? prev_child : nullptr;
}