diff --git a/direct-composition/Cargo.toml b/direct-composition/Cargo.toml index 032f7ad2c2..f9bfa2eeb9 100644 --- a/direct-composition/Cargo.toml +++ b/direct-composition/Cargo.toml @@ -9,5 +9,5 @@ euclid = "0.17" gleam = "0.5" mozangle = {version = "0.1", features = ["egl"]} webrender = {path = "../webrender"} -winapi = {version = "0.3", features = ["winerror", "d3d11", "dcomp"]} -winit = "0.13" +winapi = {version = "0.3.5", features = ["winerror", "d3d11", "dcomp"]} +winit = "0.16.0" diff --git a/direct-composition/src/main_windows.rs b/direct-composition/src/main_windows.rs index a503ea6c80..e6679947a9 100644 --- a/direct-composition/src/main_windows.rs +++ b/direct-composition/src/main_windows.rs @@ -11,7 +11,8 @@ extern crate winit; use direct_composition::DirectComposition; use std::sync::mpsc; use webrender::api; -use winit::os::windows::WindowExt; +use winit::os::windows::{WindowExt, WindowBuilderExt}; +use winit::dpi::LogicalSize; fn main() { let mut events_loop = winit::EventsLoop::new(); @@ -21,12 +22,15 @@ fn main() { let window = winit::WindowBuilder::new() .with_title("WebRender + ANGLE + DirectComposition") - .with_dimensions(1024, 768) + .with_dimensions(LogicalSize::new(1024., 768.)) + .with_decorations(true) + .with_transparency(true) + .with_no_redirection_bitmap(true) .build(&events_loop) .unwrap(); let composition = direct_composition_from_window(&window); - let factor = window.hidpi_factor(); + let factor = window.get_hidpi_factor() as f32; let mut clicks: usize = 0; let mut offset_y = 100.; @@ -55,7 +59,7 @@ fn main() { winit::WindowEvent::MouseWheel { delta, .. } => { let dy = match delta { winit::MouseScrollDelta::LineDelta(_, dy) => dy, - winit::MouseScrollDelta::PixelDelta(_, dy) => dy, + winit::MouseScrollDelta::PixelDelta(p) => p.y as f32, }; offset_y = (offset_y - 10. * dy).max(0.).min(468.);