UI: Avoid looping at end of window content

This commit is contained in:
Luke Street
2026-05-04 11:49:12 -06:00
parent f61bd3e5ad
commit 5121437bcf
3 changed files with 7 additions and 3 deletions
+4 -2
View File
@@ -97,8 +97,10 @@ void update() noexcept {
if (auto* context = aurora::rmlui::get_context();
context != nullptr && context->GetFocusElement() == nullptr)
{
if (auto* top = top_document()) {
top->focus();
for (auto& doc : std::views::reverse(sDocuments)) {
if (!doc->closed() && !doc->pending_close() && doc->focus()) {
break;
}
}
}