From 939c41aba9b8651cef684f5912aec6e7f39de84b Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Tue, 22 Oct 2019 20:51:37 +0200 Subject: [PATCH] st/oxr: If the app called request-exit, go to exiting instead of ready. --- src/xrt/state_trackers/oxr/oxr_objects.h | 1 + src/xrt/state_trackers/oxr/oxr_session.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/xrt/state_trackers/oxr/oxr_objects.h b/src/xrt/state_trackers/oxr/oxr_objects.h index fa129f459..4a4fac924 100644 --- a/src/xrt/state_trackers/oxr/oxr_objects.h +++ b/src/xrt/state_trackers/oxr/oxr_objects.h @@ -933,6 +933,7 @@ struct oxr_session XrSessionState state; bool frame_started; + bool exiting; struct u_hashmap_int *act_sets; struct u_hashmap_int *sources; diff --git a/src/xrt/state_trackers/oxr/oxr_session.c b/src/xrt/state_trackers/oxr/oxr_session.c index cb90d513c..74a19f9f0 100644 --- a/src/xrt/state_trackers/oxr/oxr_session.c +++ b/src/xrt/state_trackers/oxr/oxr_session.c @@ -145,8 +145,11 @@ oxr_session_end(struct oxr_logger *log, struct oxr_session *sess) } oxr_session_change_state(log, sess, XR_SESSION_STATE_IDLE); - oxr_session_change_state(log, sess, XR_SESSION_STATE_READY); - + if (sess->exiting) { + oxr_session_change_state(log, sess, XR_SESSION_STATE_EXITING); + } else { + oxr_session_change_state(log, sess, XR_SESSION_STATE_READY); + } return oxr_session_success_result(sess); } @@ -166,6 +169,7 @@ oxr_session_request_exit(struct oxr_logger *log, struct oxr_session *sess) } //! @todo start fading out the app. oxr_session_change_state(log, sess, XR_SESSION_STATE_STOPPING); + sess->exiting = true; return oxr_session_success_result(sess); }