diff --git a/ports/servo/Cargo.toml b/ports/servo/Cargo.toml index 408082caab3..c7a9f3f25f8 100644 --- a/ports/servo/Cargo.toml +++ b/ports/servo/Cargo.toml @@ -43,7 +43,7 @@ lazy_static = "1" libservo = {path = "../../components/servo"} log = "0.4" tinyfiledialogs = "3.0" -winit = "0.15" +winit = {version = "0.15", features = ["icon_loading"]} [target.'cfg(not(target_os = "android"))'.dependencies] sig = "0.1" diff --git a/ports/servo/glutin_app/window.rs b/ports/servo/glutin_app/window.rs index d7cca306fc8..3816125bcfc 100644 --- a/ports/servo/glutin_app/window.rs +++ b/ports/servo/glutin_app/window.rs @@ -201,6 +201,13 @@ impl Window { .with_visibility(visible) .with_multitouch(); + #[cfg(any(target_os = "linux", target_os = "windows"))] + { + let icon_bytes = include_bytes!("../../../resources/servo64.png"); + let icon = Some(winit::Icon::from_bytes(icon_bytes).expect("Failed to open icon")); + window_builder = window_builder.with_window_icon(icon); + } + window_builder = builder_with_platform_options(window_builder); let mut context_builder = ContextBuilder::new() @@ -525,7 +532,7 @@ impl Window { .. } => self.event_queue.borrow_mut().push(WindowEvent::Refresh), Event::WindowEvent { - event: winit::WindowEvent::Closed, + event: winit::WindowEvent::CloseRequested, .. } => { self.event_queue.borrow_mut().push(WindowEvent::Quit); diff --git a/resources/servo64.png b/resources/servo64.png new file mode 100644 index 00000000000..3511b723c4f Binary files /dev/null and b/resources/servo64.png differ