set user presence on session pause / resume
This commit is contained in:
@@ -248,6 +248,11 @@ std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_ses
|
||||
info.hand_tracking = config.check_feature(feature::hand_tracking);
|
||||
info.eye_gaze = config.check_feature(feature::eye_gaze);
|
||||
|
||||
if (self->instance.has_extension(XR_EXT_USER_PRESENCE_EXTENSION_NAME))
|
||||
{
|
||||
info.user_presence = self->system.user_presence_properties().supportsUserPresence;
|
||||
}
|
||||
|
||||
if (config.check_feature(feature::face_tracking))
|
||||
{
|
||||
switch (self->system.face_tracker_supported())
|
||||
|
||||
@@ -405,8 +405,16 @@ void wivrn_session::pause_session()
|
||||
assert(mnd_ipc_server);
|
||||
|
||||
// notify clients about session pause
|
||||
|
||||
update_client_states(false, false);
|
||||
|
||||
if (get_info().user_presence)
|
||||
{
|
||||
(*this)(from_headset::user_presence_changed{
|
||||
.present = false,
|
||||
});
|
||||
}
|
||||
|
||||
// pause session components
|
||||
|
||||
worker_thread = std::jthread();
|
||||
@@ -441,15 +449,24 @@ void wivrn_session::resume_session()
|
||||
float target_fps = get_default_rate(get_info(), *get_settings());
|
||||
|
||||
if (target_fps != comp_target->get_refresh_rate())
|
||||
{
|
||||
(*this)(from_headset::refresh_rate_changed{
|
||||
.from = comp_target->get_refresh_rate(),
|
||||
.to = target_fps,
|
||||
});
|
||||
}
|
||||
|
||||
comp_target->resume();
|
||||
}
|
||||
}
|
||||
|
||||
if (get_info().user_presence)
|
||||
{
|
||||
(*this)(from_headset::user_presence_changed{
|
||||
.present = true,
|
||||
});
|
||||
}
|
||||
|
||||
(*this)(from_headset::get_application_list{
|
||||
.language = get_info().language,
|
||||
.country = get_info().country,
|
||||
|
||||
Reference in New Issue
Block a user