Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
795 changes: 377 additions & 418 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ wasmtimer = "0.4.2"
web-sys = "=0.3.85"
web-time = "1.1"
wgpu = { version = "29", default-features = false, features = ["std", "wgsl"] }
winit = { git = "https://github.com/iced-rs/winit.git", rev = "05b8ff17a06562f0a10bb46e6eaacbe2a95cb5ed", default-features = false, features = ["rwh_06"] }
winit = { git = "https://github.com/rust-windowing/winit.git", rev = "f5e20bd7da25934f39abe8dc44a0597110ef6357", default-features = false }

[workspace.lints.rust]
rust_2018_idioms = { level = "deny", priority = -1 }
Expand Down
24 changes: 13 additions & 11 deletions examples/integration/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn main() -> Result<(), winit::error::EventLoopError> {
enum Runner {
Loading,
Ready {
window: Arc<winit::window::Window>,
window: Arc<dyn winit::window::Window>,
queue: wgpu::Queue,
device: wgpu::Device,
surface: wgpu::Surface<'static>,
Expand All @@ -53,15 +53,15 @@ pub fn main() -> Result<(), winit::error::EventLoopError> {
}

impl winit::application::ApplicationHandler for Runner {
fn resumed(&mut self, event_loop: &winit::event_loop::ActiveEventLoop) {
fn resumed(&mut self, event_loop: &dyn winit::event_loop::ActiveEventLoop) {
if let Self::Loading = self {
let window = Arc::new(
let window: Arc<dyn winit::window::Window> = Arc::from(
event_loop
.create_window(winit::window::WindowAttributes::default())
.expect("Create window"),
);

let physical_size = window.inner_size();
let physical_size = window.surface_size();
let viewport = Viewport::with_physical_size(
Size::new(physical_size.width, physical_size.height),
renderer::Scale {
Expand Down Expand Up @@ -174,9 +174,11 @@ pub fn main() -> Result<(), winit::error::EventLoopError> {
}
}

fn can_create_surfaces(&mut self, _event_loop: &dyn winit::event_loop::ActiveEventLoop) {}

fn window_event(
&mut self,
event_loop: &winit::event_loop::ActiveEventLoop,
event_loop: &dyn winit::event_loop::ActiveEventLoop,
_window_id: winit::window::WindowId,
event: WindowEvent,
) {
Expand Down Expand Up @@ -207,7 +209,7 @@ pub fn main() -> Result<(), winit::error::EventLoopError> {
match event {
WindowEvent::RedrawRequested => {
if *resized {
let size = window.inner_size();
let size = window.surface_size();

*viewport = Viewport::with_physical_size(
Size::new(size.width, size.height),
Expand Down Expand Up @@ -285,7 +287,7 @@ pub fn main() -> Result<(), winit::error::EventLoopError> {
if let Some(icon) =
iced_winit::conversion::mouse_interaction(mouse_interaction)
{
window.set_cursor(icon);
window.set_cursor(winit::cursor::Cursor::Icon(icon));
window.set_cursor_visible(true);
} else {
window.set_cursor_visible(false);
Expand All @@ -312,7 +314,7 @@ pub fn main() -> Result<(), winit::error::EventLoopError> {
}
}
}
WindowEvent::CursorMoved { position, .. } => {
WindowEvent::PointerMoved { position, .. } => {
*cursor = mouse::Cursor::Available(conversion::cursor_position(
position,
viewport.scale_factor(),
Expand All @@ -321,7 +323,7 @@ pub fn main() -> Result<(), winit::error::EventLoopError> {
WindowEvent::ModifiersChanged(new_modifiers) => {
*modifiers = new_modifiers.state();
}
WindowEvent::Resized(_) => {
WindowEvent::SurfaceResized(_) => {
*resized = true;
}
WindowEvent::CloseRequested => {
Expand Down Expand Up @@ -365,6 +367,6 @@ pub fn main() -> Result<(), winit::error::EventLoopError> {
}
}

let mut runner = Runner::Loading;
event_loop.run_app(&mut runner)
let runner = Runner::Loading;
event_loop.run_app(runner)
}
4 changes: 0 additions & 4 deletions winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,3 @@ wasm-bindgen-futures.workspace = true
[target.'cfg(target_os = "linux")'.dependencies]
mundy.workspace = true
mundy.optional = true

# Delete once we update to `winit 0.31`
[target.'cfg(target_os = "macos")'.dependencies]
objc2 = { version = "0.5", features = ["relax-sign-encoding"] }
Loading