only force prompt focus if mouse is not active

This commit is contained in:
thecozies 2024-05-01 10:17:16 -05:00
parent 78fcab1822
commit e8b54842f2

View file

@ -1055,6 +1055,7 @@ struct UIContext {
Rml::Element* focused = current_document->GetFocusLeafNode(); Rml::Element* focused = current_document->GetFocusLeafNode();
// Check if unfocused or current focus isn't either prompt button // Check if unfocused or current focus isn't either prompt button
if (mouse_is_active == false) {
if ( if (
focused == nullptr || ( focused == nullptr || (
focused != current_document->GetElementById("prompt__cancel-button") && focused != current_document->GetElementById("prompt__cancel-button") &&
@ -1063,6 +1064,7 @@ struct UIContext {
) { ) {
ctx->shouldFocus = true; ctx->shouldFocus = true;
} }
}
if (!ctx->shouldFocus) { if (!ctx->shouldFocus) {
return; return;