From b9af535cf229acdbf7f1b534e9804c1b4e3fa3e1 Mon Sep 17 00:00:00 2001 From: Sapphire Date: Fri, 7 Nov 2025 20:41:16 -0600 Subject: [PATCH 7/8] st/oxr: push XrEventDataInteractionProfileChanged when profile changes to NULL --- src/xrt/state_trackers/oxr/oxr_input.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/xrt/state_trackers/oxr/oxr_input.c b/src/xrt/state_trackers/oxr/oxr_input.c index df2b479eb..c4b36ba81 100644 --- a/src/xrt/state_trackers/oxr/oxr_input.c +++ b/src/xrt/state_trackers/oxr/oxr_input.c @@ -1881,26 +1881,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