Files
WiVRn/patches/monado/0007-st-oxr-push-XrEventDataInteractionProfileChanged-whe.patch
T
2026-02-21 17:11:22 +01:00

50 lines
2.4 KiB
Diff

From 78aa739c623f7c797f92f2905b59bc73446f3e32 Mon Sep 17 00:00:00 2001
From: Sapphire <imsapphire0@gmail.com>
Date: Fri, 7 Nov 2025 20:41:16 -0600
Subject: [PATCH 7/9] st/oxr: push XrEventDataInteractionProfileChanged when
profile changes to NULL
---
src/xrt/state_trackers/oxr/actions/oxr_input.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/src/xrt/state_trackers/oxr/actions/oxr_input.c b/src/xrt/state_trackers/oxr/actions/oxr_input.c
index 95eef613a..c76dfcb0c 100644
--- a/src/xrt/state_trackers/oxr/actions/oxr_input.c
+++ b/src/xrt/state_trackers/oxr/actions/oxr_input.c
@@ -1885,26 +1885,21 @@ oxr_session_update_action_bindings(struct oxr_logger *log, struct oxr_session *s
}
}
- /*
- * This code will only send events (and update the bindings) if there
- * is a profile mapped to the subaction path. Meaning it won't update
- * the cache or generate events when a controller goes away, basically
- * latching the interaction profile to the last active device.
- */
+ bool any_profile_changed = false;
#define POPULATE_PROFILE(X) \
do { \
XrPath path = profiles.X != NULL ? profiles.X->path : XR_NULL_PATH; \
- if (path == XR_NULL_PATH) { \
- break; /* Only update on "active" interaction profiles per sub-action path. */ \
- } \
if (sess->X != path) { \
sess->X = path; \
- oxr_event_push_XrEventDataInteractionProfileChanged(log, sess); \
+ any_profile_changed = true; \
} \
} while (false);
OXR_FOR_EACH_VALID_SUBACTION_PATH(POPULATE_PROFILE)
#undef POPULATE_PROFILE
+ if (any_profile_changed) {
+ oxr_event_push_XrEventDataInteractionProfileChanged(log, sess);
+ }
return oxr_session_success_result(sess);
}
--
2.53.0