Fire sessionavailable if in transient mode

This commit is contained in:
Paul Rouget 2020-07-20 12:05:55 +02:00
parent 5f31dbf993
commit b42d441732
3 changed files with 11 additions and 3 deletions

View file

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