XGameUi: a text entry's limit is the console's #370

Manually merged
github merged 1 commit from gh-pr/370/head into gh-pr/370/base 2026-11-26 04:01:17 +00:00
Owner

@⁠marquezinii on GitHub · 2026-11-24 02:42 UTC · original
marquezinii:fix/text-entry-length-limit → main · +62 −7 · 1 files · 1 commits · merged 2026-11-25 00:10 UTC

XGameUiShowTextEntryAsync ignored the length rules the GDK documents for maxTextLength: "On console, the maximum number of characters is 1024. [...] If the value 0 is passed in, it will be treated as a maximum character length of 1024. Further, if the inputScope is XGameUiTextEntryInputScope::Password, the maximum length will always be 1024 and the maxTextLength value will be ignored."

Here 0 meant no limit (the result kept whatever was typed, and EM_LIMITTEXT with 0 lifts the edit box's cap), limits above 1024 were kept, and the scope was not read, so a password entry was cut to the title's limit.

The limit is now worked out once from the scope and the title's value, and used for both the dialog and the result.

Tested: a new test checks the rule itself and two calls through the object: a 2000-character default with limit 0 now gives 1025 bytes (it gave 2006 before), and a password entry with limit 8 keeps all 8 + 1 characters. cargo test -p victory-hle passes and clippy reports nothing new. The host dialog itself was not opened.

https://learn.microsoft.com/gaming/gdk/docs/reference/system/xgameui/functions/xgameuishowtextentryasync

**@⁠marquezinii** on GitHub · 2026-11-24 02:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/370) `marquezinii:fix/text-entry-length-limit` → `main` · +62 −7 · 1 files · 1 commits · merged 2026-11-25 00:10 UTC `XGameUiShowTextEntryAsync` ignored the length rules the GDK documents for `maxTextLength`: "On console, the maximum number of characters is 1024. [...] If the value 0 is passed in, it will be treated as a maximum character length of 1024. Further, if the *inputScope* is XGameUiTextEntryInputScope::Password, the maximum length will always be 1024 and the *maxTextLength* value will be ignored." Here 0 meant no limit (the result kept whatever was typed, and `EM_LIMITTEXT` with 0 lifts the edit box's cap), limits above 1024 were kept, and the scope was not read, so a password entry was cut to the title's limit. The limit is now worked out once from the scope and the title's value, and used for both the dialog and the result. Tested: a new test checks the rule itself and two calls through the object: a 2000-character default with limit 0 now gives 1025 bytes (it gave 2006 before), and a password entry with limit 8 keeps all 8 + 1 characters. `cargo test -p victory-hle` passes and clippy reports nothing new. The host dialog itself was not opened. https://learn.microsoft.com/gaming/gdk/docs/reference/system/xgameui/functions/xgameuishowtextentryasync
XGameUiShowTextEntryAsync documents a 1024-character maximum on console,
1024 for a maxTextLength of 0, and 1024 for the Password scope whatever
the title asks. 0 meant no limit here, larger limits were kept and the
scope was ignored.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:01:15 +00:00
github manually merged commit 936e5e51c9 into gh-pr/370/base 2026-11-26 04:01:17 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-24 04:06 UTC · original

Thanks @⁠marquezinii for this change. I tested head 936e5e51c91c7b380a4729aeaa2255824ce8085a with:

cargo test --locked -p victory-hle --lib text_entry_limits_follow_the_console -- --test-threads=1

Result: 1 passed, 0 failed (86 filtered out). The test covers the console limit rule for zero and over-1024 title limits, password scope, and the resulting object-call length. It does not open the host text-entry dialog.

**@⁠jeremygold02** on GitHub · 2026-11-24 04:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/370#issuecomment-7121716632) Thanks @⁠marquezinii for this change. I tested head `936e5e51c91c7b380a4729aeaa2255824ce8085a` with: ``` cargo test --locked -p victory-hle --lib text_entry_limits_follow_the_console -- --test-threads=1 ``` Result: 1 passed, 0 failed (86 filtered out). The test covers the console limit rule for zero and over-1024 title limits, password scope, and the resulting object-call length. It does not open the host text-entry dialog.
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!370
No description provided.