UWP: allow servo's initial URL to be set before Servo starts

This commit is contained in:
Paul Rouget 2020-07-06 11:49:13 +02:00
parent d93e67a0bf
commit 79ecc7e216
5 changed files with 26 additions and 13 deletions

View file

@ -379,6 +379,8 @@ void ServoControl::TryLoadUri(hstring input) {
});
}
});
} else {
mInitUrl = input;
}
}
@ -398,8 +400,8 @@ void ServoControl::Loop() {
log(L"Entering loop");
ServoDelegate *sd = static_cast<ServoDelegate *>(this);
EGLNativeWindowType win = GetNativeWindow();
mServo = std::make_unique<Servo>(mArgs, mPanelWidth, mPanelHeight, win,
mDPI, *sd);
mServo = std::make_unique<Servo>(mInitUrl, mArgs, mPanelWidth, mPanelHeight,
win, mDPI, *sd);
} else {
// FIXME: this will fail since create_task didn't pick the thread
// where Servo was running initially.