VR keyboard: a closed keyboard popup's instance detaches itself

Its 0.5 s poll (a SharedJSContext timer) kept running until the next
injection and could publish a hidden strip with its own sequence numbers
over the new popup's, so a pick on the panel was dropped as stale. The
poll now detaches it once the popup's document is gone.
This commit is contained in:
Pierre Kisters committed 2026-10-01 04:09:13 +02:00
1 parent 76de7734c1
commit 70e9a1aeb1
1 file changed
+4 -1
+4 -1
View File
@@ -36,7 +36,7 @@
// Steam's events. Debugging: __sfuiSwipeLog, __sfuiSwipePaths
// (scripts/vr-keyboard-replay.mjs).
((find, sigs, opts, hooks, D, T, C, DICT, P, HUB, F) => {
const VERSION = 27;
const VERSION = 28;
const G = window;
const O = opts;
@@ -218,6 +218,9 @@
const idOf = (o) => (o && typeof o === 'object' ? (ids.get(o) ?? (ids.set(o, nextId), nextId++)) : 0);
let lastTarget = null, idle = false;
const poll = setInterval(() => {
// Popup closed: detach now (else on the next injection), so this
// instance stops publishing over the next popup's strip.
if (!doc.defaultView) { S.docs.get(doc)?.(); S.docs.delete(doc); return; }
const s = status.VRKeyboardStatus;
const target = [s?.bIsOpen, s?.sOverlayKey, s?.unAppID, idOf(inst0.props?.VirtualKeyboardManager?.m_ActiveElementProps)].join('|');
if (lastTarget !== null && target !== lastTarget) reset(`target ${target}`, { boundary: true });