diff --git a/src/app.rs b/src/app.rs index 7e332546..cccb1b3d 100644 --- a/src/app.rs +++ b/src/app.rs @@ -4,7 +4,6 @@ use servo::{ CompositeTarget, }, embedder_traits::EventLoopWaker, - msg::constellation_msg::BrowsingContextId, servo_url::ServoUrl, Servo, TopLevelBrowsingContextId, }; diff --git a/src/main.rs b/src/main.rs index 03207a96..c63dadff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,7 +21,6 @@ fn main() -> Result<()> { event_loop.listen_device_events(DeviceEvents::Never); let window = WindowBuilder::new() .with_title("(*゚▽゚)ノ Verso") - // .with_maximized(true) .build(&event_loop)?; #[cfg(target_os = "macos")] diff --git a/src/window.rs b/src/window.rs index 3b15b218..e610ddd6 100644 --- a/src/window.rs +++ b/src/window.rs @@ -215,19 +215,18 @@ impl Window { Some(p) if p == self.panel.id() => { log::trace!("Verso Panel {p:?} is handling servo message: {m:?}",); match m { - EmbedderMsg::LoadStart => { - let mut rect = self.get_coordinates().get_viewport().to_f32(); - rect.max.y /= 10.; - events.push(EmbedderEvent::FocusWebView(p)); - events.push(EmbedderEvent::MoveResizeWebView(p, rect)); - need_present = false; - } - EmbedderMsg::HeadParsed => { + EmbedderMsg::LoadStart | EmbedderMsg::HeadParsed => { need_present = false; } EmbedderMsg::LoadComplete => { need_present = true; } + EmbedderMsg::WebViewOpened(w) => { + let mut rect = self.get_coordinates().get_viewport().to_f32(); + rect.max.y /= 10.; + events.push(EmbedderEvent::FocusWebView(w)); + events.push(EmbedderEvent::MoveResizeWebView(w, rect)); + } EmbedderMsg::WebViewClosed(_w) => { events.push(EmbedderEvent::Quit); }