st/oxr: If the app called request-exit, go to exiting instead of ready.

This commit is contained in:
Ryan Pavlik 2019-10-22 20:51:37 +02:00
parent 6b99e2fbdc
commit 939c41aba9
2 changed files with 7 additions and 2 deletions

View file

@ -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;

View file

@ -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);
}