From aa1c2593acf2409b6cd445c47adf393caa26f169 Mon Sep 17 00:00:00 2001 From: Votre Nom Date: Tue, 5 May 2026 18:11:19 +0200 Subject: [PATCH] =?UTF-8?q?yoda:=20iced=5Fwinit=20unreachable=20+=20deprec?= =?UTF-8?q?ation=20cleanup=20(45=E2=86=9229=20warnings)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - conversion.rs: drop 4 duplicate Interaction arms (Cell/Move/Copy/Help) that were already handled higher in the same match — pure dead code from a past merge, not a real bug. - platform_specific/wayland/mod.rs: migrate HasRawDisplayHandle → HasDisplayHandle (display_handle().map(|h| h.as_raw())). - conversion.rs: #[allow(deprecated)] on key_code/winit_key_code — the warning suggests Meta but no Meta variant exists in this enum (only MetaLeft/MetaRight, which aren't equivalent to Super). - window.rs: #[allow(deprecated)] on enable_ime/disable_ime with TODO to migrate set_ime_* → request_ime_update(ImeRequest::*). - lib.rs: #[allow(deprecated)] on process_event with TODO to migrate try_next → try_recv (futures-channel API change). Leyoda 2026 – GPLv3 --- winit/src/conversion.rs | 6 ++---- winit/src/lib.rs | 2 ++ winit/src/platform_specific/wayland/mod.rs | 5 ++--- winit/src/window.rs | 5 +++++ 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs index 0afb8e72..71af6e2e 100644 --- a/winit/src/conversion.rs +++ b/winit/src/conversion.rs @@ -640,10 +640,6 @@ pub fn mouse_interaction( Interaction::AllScroll => winit_core::cursor::CursorIcon::AllScroll, Interaction::ZoomIn => winit_core::cursor::CursorIcon::ZoomIn, Interaction::ZoomOut => winit_core::cursor::CursorIcon::ZoomOut, - Interaction::Cell => winit_core::cursor::CursorIcon::Cell, - Interaction::Move => winit_core::cursor::CursorIcon::Move, - Interaction::Copy => winit_core::cursor::CursorIcon::Copy, - Interaction::Help => winit_core::cursor::CursorIcon::Help, Interaction::Hidden => { return None; } @@ -1079,6 +1075,7 @@ pub fn physical_key( /// /// [`winit`]: https://github.com/rust-windowing/winit /// [`iced`]: https://github.com/iced-rs/iced/tree/0.12 +#[allow(deprecated)] // KeyCode::Super/Hyper/Turbo: legacy spec, no Meta variant in this enum pub fn key_code( key_code: winit::keyboard::KeyCode, ) -> Option { @@ -1283,6 +1280,7 @@ pub fn key_code( }) } +#[allow(deprecated)] // KeyCode::Super/Hyper/Turbo: legacy spec, no Meta variant in this enum pub fn winit_key_code( key_code: keyboard::key::Code, ) -> Option { diff --git a/winit/src/lib.rs b/winit/src/lib.rs index 5b5d1ce1..32837143 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -362,6 +362,8 @@ where where F: Future, { + // TODO(yoda): migrate try_next → try_recv (futures-channel API change). + #[allow(deprecated)] fn process_event( &mut self, event_loop: &dyn winit::event_loop::ActiveEventLoop, diff --git a/winit/src/platform_specific/wayland/mod.rs b/winit/src/platform_specific/wayland/mod.rs index 321561da..82304b7c 100644 --- a/winit/src/platform_specific/wayland/mod.rs +++ b/winit/src/platform_specific/wayland/mod.rs @@ -18,8 +18,7 @@ use cursor_icon::CursorIcon; use iced_futures::futures::channel::mpsc; use iced_graphics::{Compositor, compositor}; use iced_runtime::core::{Vector, window}; -use raw_window_handle::{HasDisplayHandle, HasWindowHandle}; -use raw_window_handle::{HasRawDisplayHandle, RawWindowHandle}; +use raw_window_handle::{HasDisplayHandle, HasWindowHandle, RawWindowHandle}; use sctk_event::SctkEvent; use std::{collections::HashMap, sync::Arc}; use subsurface_widget::{SubsurfaceInstance, SubsurfaceState}; @@ -106,7 +105,7 @@ impl PlatformSpecific { display: OwnedDisplayHandle, ) -> Self { self.wayland.winit_event_sender = Some(tx); - self.wayland.conn = match display.raw_display_handle() { + self.wayland.conn = match display.display_handle().map(|h| h.as_raw()) { Ok(raw_window_handle::RawDisplayHandle::Wayland( wayland_display_handle, )) => { diff --git a/winit/src/window.rs b/winit/src/window.rs index 87d35a5a..89368802 100644 --- a/winit/src/window.rs +++ b/winit/src/window.rs @@ -325,6 +325,10 @@ where } } + // TODO(yoda): migrate to Window::request_ime_update(ImeRequest::*). + // Legacy set_ime_* still functional but deprecated; full migration + // requires ImeCapabilities + ImeRequestData reshape. + #[allow(deprecated)] fn enable_ime( &mut self, cursor: Rectangle, @@ -355,6 +359,7 @@ where } } + #[allow(deprecated)] // see TODO on enable_ime fn disable_ime(&mut self) { if self.ime_state.is_some() { self.raw.set_ime_allowed(false);