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,13 +1055,15 @@ 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 ( if (mouse_is_active == false) {
focused == nullptr || ( if (
focused != current_document->GetElementById("prompt__cancel-button") && focused == nullptr || (
focused != current_document->GetElementById("prompt__confirm-button") focused != current_document->GetElementById("prompt__cancel-button") &&
) focused != current_document->GetElementById("prompt__confirm-button")
) { )
ctx->shouldFocus = true; ) {
ctx->shouldFocus = true;
}
} }
if (!ctx->shouldFocus) { if (!ctx->shouldFocus) {