mirror of
https://github.com/servo/servo.git
synced 2025-08-13 09:25:32 +01:00
libservo: Add WebView
immediately to the Compositor (#35662)
When creating a `WebView`, let the Compositor know synchronously that it exists. This allows the embedder to immediately call methods like `WebView::focus()`. In addition remove messages associated with the `WebViewDelegate::notify_ready_to_show()` method (and the method itself), as now `WebView`s can be shown immediately. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
de66f72197
commit
9d5171f3c5
12 changed files with 46 additions and 89 deletions
|
@ -127,10 +127,6 @@ impl WebViewDelegate for RunningAppState {
|
|||
.notify_load_status_changed(load_status);
|
||||
}
|
||||
|
||||
fn notify_ready_to_show(&self, webview: WebView) {
|
||||
webview.focus();
|
||||
}
|
||||
|
||||
fn notify_closed(&self, webview: WebView) {
|
||||
{
|
||||
let mut inner_mut = self.inner_mut();
|
||||
|
@ -308,6 +304,7 @@ impl RunningAppState {
|
|||
pub(crate) fn new_toplevel_webview(self: &Rc<Self>, url: Url) {
|
||||
let webview = self.servo.new_webview(url);
|
||||
webview.set_delegate(self.clone());
|
||||
webview.focus();
|
||||
self.add(webview.clone());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue