Fix find_next_valid_focus() freeze

(cherry picked from commit 8d62b736b2)
This commit is contained in:
kobewi 2022-07-01 00:25:10 +02:00 committed by Rémi Verschelde
parent 316eea5046
commit 14f69acaa4
1 changed files with 2 additions and 2 deletions

View File

@ -1903,7 +1903,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; return (get_focus_mode() == FOCUS_ALL) ? next_child : nullptr;
} }
if (next_child) { if (next_child) {
@ -1987,7 +1987,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; return (get_focus_mode() == FOCUS_ALL) ? prev_child : nullptr;
} }