aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--support/hololens/ServoApp/ServoControl/Servo.cpp10
-rw-r--r--support/hololens/ServoApp/ServoControl/Servo.h2
-rw-r--r--support/hololens/ServoApp/ServoControl/ServoControl.cpp2
3 files changed, 11 insertions, 3 deletions
diff --git a/support/hololens/ServoApp/ServoControl/Servo.cpp b/support/hololens/ServoApp/ServoControl/Servo.cpp
index 7adef0a8511..293fcb0d9dc 100644
--- a/support/hololens/ServoApp/ServoControl/Servo.cpp
+++ b/support/hololens/ServoApp/ServoControl/Servo.cpp
@@ -136,7 +136,7 @@ const char *prompt_input(const char *message, const char *default,
Servo::Servo(std::optional<hstring> initUrl, hstring args, GLsizei width,
GLsizei height, EGLNativeWindowType eglNativeWindow, float dpi,
- ServoDelegate &aDelegate)
+ ServoDelegate &aDelegate, bool transient)
: mWindowHeight(height), mWindowWidth(width), mDelegate(aDelegate) {
ApplicationDataContainer localSettings =
ApplicationData::Current().LocalSettings();
@@ -192,6 +192,14 @@ Servo::Servo(std::optional<hstring> initUrl, hstring args, GLsizei width,
#endif
}
+ if (transient) {
+ capi::CPref cpref;
+ cpref.key = "dom.webxr.sessionavailable";
+ cpref.pref_type = capi::CPrefType::Bool;
+ cpref.value = &transient;
+ cprefs.push_back(cpref);
+ }
+
capi::CPrefList prefsList = {cprefs.size(), cprefs.data()};
capi::CInitOptions o;
diff --git a/support/hololens/ServoApp/ServoControl/Servo.h b/support/hololens/ServoApp/ServoControl/Servo.h
index e6eaf428be1..8fc01b73fe1 100644
--- a/support/hololens/ServoApp/ServoControl/Servo.h
+++ b/support/hololens/ServoApp/ServoControl/Servo.h
@@ -28,7 +28,7 @@ class ServoDelegate;
class Servo {
public:
Servo(std::optional<hstring>, hstring, GLsizei, GLsizei, EGLNativeWindowType,
- float, ServoDelegate &);
+ float, ServoDelegate &, bool);
~Servo();
ServoDelegate &Delegate() { return mDelegate; }
diff --git a/support/hololens/ServoApp/ServoControl/ServoControl.cpp b/support/hololens/ServoApp/ServoControl/ServoControl.cpp
index d0d1e814e91..9898f0ea258 100644
--- a/support/hololens/ServoApp/ServoControl/ServoControl.cpp
+++ b/support/hololens/ServoApp/ServoControl/ServoControl.cpp
@@ -407,7 +407,7 @@ void ServoControl::Loop() {
ServoDelegate *sd = static_cast<ServoDelegate *>(this);
EGLNativeWindowType win = GetNativeWindow();
mServo = std::make_unique<Servo>(mInitUrl, mArgs, mPanelWidth, mPanelHeight,
- win, mDPI, *sd);
+ win, mDPI, *sd, mTransient);
} else {
// FIXME: this will fail since create_task didn't pick the thread
// where Servo was running initially.