mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +01:00
Fire sessionavailable if in transient mode
This commit is contained in:
parent
5f31dbf993
commit
b42d441732
3 changed files with 11 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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; }
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue