openxr_data: fire VREvent_Quit event when session state changes to STOPPING#230
openxr_data: fire VREvent_Quit event when session state changes to STOPPING#230ImSapphire wants to merge 2 commits into
Conversation
5a7b718 to
0ff50fb
Compare
1537d95 to
273ad97
Compare
|
Sorry for the delay. Looks good, but a test for this would be cool. |
273ad97 to
06a5c92
Compare
I'm not exactly sure how to write unit tests, and I'm working on some other things right now, would it be fine to merge without a test? |
|
|
@Supreeeme Would emitting |
06a5c92 to
40b491b
Compare
|
Based on the spec, I think the correct thing to do would be:
|
|
iirc in SteamVR, AcknowledgeQuit_Exiting just extends SteamVR's kill timer to give the app time to safely shutdown, if we stop the session there we'd probably crash because the game would keep calling functions like WaitGetPoses, Get*ActionData etc. Not sure what the right thing to do there is |
|
Some apps also simply don't call AcknowledgeQuit_Exiting (VRChat, Resonite from what I've tested so far) |
40b491b to
178eaea
Compare
178eaea to
caac0c2
Compare
caac0c2 to
b7072eb
Compare
|
Added a test |
b7072eb to
666dbc2
Compare
666dbc2 to
0d8d322
Compare
|
@Supreeeme is there anything I could do to get this merged? |
0d8d322 to
3cd1cfe
Compare
| state = Some(event.state()); | ||
| info!("OpenXR session state changed: {:?}", event.state()); | ||
| if let Some(system) = self.system.get().filter(|_| { | ||
| (cfg!(test) || session_data.temp_vulkan.is_none()) |
There was a problem hiding this comment.
Why is this unconditional for tests?
There was a problem hiding this comment.
When running the test, the session is using a temp vulkan instance, that seemed like the easiest way to get it working to me
There was a problem hiding this comment.
I don't love adding test specific logic to actual code. I think it would be better to have some kind of use_real_session helper method in the test that handles doing this.
3cd1cfe to
3a4e123
Compare
3a4e123 to
4265b0d
Compare
Tested in VRChat via closing with WiVRn's quit button.