From 37d8a503e48b7641b1f317e3f451ed8b158d2247 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 28 Jul 2026 14:29:36 +0000 Subject: [PATCH] Mark extensible enums in winit-core as #[non_exhaustive] Event, input source, error, data transfer, native key, IME request, scroll delta and fullscreen enums can now gain variants without a breaking change. Backends and examples get wildcard arms where they matched exhaustively; unknown IME requests are reported as ImeRequestError::NotSupported and unknown fullscreen modes behave like Fullscreen::Borderless(None). --- winit-android/src/event_loop.rs | 1 + winit-appkit/src/cursor.rs | 2 +- winit-appkit/src/dnd.rs | 1 + winit-appkit/src/event_loop.rs | 1 + winit-appkit/src/window_delegate.rs | 5 ++++- winit-core/src/cursor.rs | 3 +++ winit-core/src/data_transfer.rs | 2 ++ winit-core/src/event.rs | 8 ++++++++ winit-core/src/event_loop/mod.rs | 1 + winit-core/src/icon.rs | 1 + winit-core/src/keyboard.rs | 2 ++ winit-core/src/monitor.rs | 1 + winit-core/src/window.rs | 2 ++ winit-orbital/src/window.rs | 1 + winit-uikit/src/window.rs | 7 +++---- winit-wayland/src/dnd.rs | 1 + winit-wayland/src/event_loop/mod.rs | 2 +- winit-wayland/src/window/mod.rs | 6 +++--- winit-wayland/src/window/state.rs | 1 + winit-web/src/cursor.rs | 1 + winit-web/src/web_sys/event.rs | 2 +- winit-web/src/web_sys/fullscreen.rs | 1 + winit-web/src/web_sys/pointer.rs | 6 +++--- winit-win32/src/dnd.rs | 2 ++ winit-win32/src/event_loop.rs | 3 ++- winit-win32/src/window.rs | 6 ++++-- winit-x11/src/util/cursor.rs | 2 +- winit-x11/src/window.rs | 5 ++--- winit/examples/application.rs | 1 + winit/examples/ime.rs | 1 + 30 files changed, 57 insertions(+), 21 deletions(-) diff --git a/winit-android/src/event_loop.rs b/winit-android/src/event_loop.rs index 430191535..8ffb1a3a9 100644 --- a/winit-android/src/event_loop.rs +++ b/winit-android/src/event_loop.rs @@ -977,6 +977,7 @@ impl CoreWindow for Window { *current_caps = None; self.app.hide_soft_input(true); }, + _ => return Err(ImeRequestError::NotSupported), } Ok(()) diff --git a/winit-appkit/src/cursor.rs b/winit-appkit/src/cursor.rs index be47e4365..c41c3e9b2 100644 --- a/winit-appkit/src/cursor.rs +++ b/winit-appkit/src/cursor.rs @@ -34,7 +34,7 @@ impl CustomCursor { pub(crate) fn new(cursor: CustomCursorSource) -> Result { let cursor = match cursor { CustomCursorSource::Image(cursor_image) => cursor_image, - CustomCursorSource::Animation { .. } | CustomCursorSource::Url { .. } => { + _ => { return Err(NotSupportedError::new("unsupported cursor kind").into()); }, }; diff --git a/winit-appkit/src/dnd.rs b/winit-appkit/src/dnd.rs index 1a4c86f41..3dd44c309 100644 --- a/winit-appkit/src/dnd.rs +++ b/winit-appkit/src/dnd.rs @@ -453,6 +453,7 @@ impl PasteboardWriterState { SendData::Uris(_) => None, SendData::String(string) => Some(NSString::from_str(&string).into()), SendData::Bytes(binary) => Some(NSData::from_vec(binary).into()), + _ => None, } } } diff --git a/winit-appkit/src/event_loop.rs b/winit-appkit/src/event_loop.rs index a2bc584ee..674aa3db7 100644 --- a/winit-appkit/src/event_loop.rs +++ b/winit-appkit/src/event_loop.rs @@ -248,6 +248,7 @@ impl RootActiveEventLoop for ActiveEventLoop { .chain(Vec::new().into_iter().map(ns_url_from_str)), ), SendData::Bytes(_) => None, + _ => None, } }) .into_iter() diff --git a/winit-appkit/src/window_delegate.rs b/winit-appkit/src/window_delegate.rs index f28d34b97..a2077a58a 100644 --- a/winit-appkit/src/window_delegate.rs +++ b/winit-appkit/src/window_delegate.rs @@ -227,6 +227,7 @@ define_class!( // in fullscreen, so we must've reached here by `set_fullscreen` // as it updates the state Some(Fullscreen::Borderless(_)) => (), + Some(_) => (), // Otherwise, we must've reached fullscreen by the user clicking // on the green fullscreen button. Update state! None => { @@ -667,6 +668,7 @@ fn new_window( monitor.ns_screen(mtm).or_else(|| NSScreen::mainScreen(mtm)) }, Some(Fullscreen::Borderless(None)) => NSScreen::mainScreen(mtm), + Some(_) => NSScreen::mainScreen(mtm), None => None, }; let frame = match &screen { @@ -1683,7 +1685,7 @@ impl WindowDelegate { let monitor = monitor.cast_ref::().unwrap(); monitor.ns_screen(mtm) }, - Fullscreen::Borderless(None) => { + _ => { if let Some(monitor) = self.current_monitor_inner() { monitor.ns_screen(mtm) } else { @@ -1928,6 +1930,7 @@ impl WindowDelegate { self.view().disable_ime(); return Ok(()); }, + _ => return Err(ImeRequestError::NotSupported), }; if let Some((spot, size)) = request_data.cursor_area { diff --git a/winit-core/src/cursor.rs b/winit-core/src/cursor.rs index 0a600cdd2..94de602d3 100644 --- a/winit-core/src/cursor.rs +++ b/winit-core/src/cursor.rs @@ -111,6 +111,7 @@ impl_dyn_casting!(CustomCursorProvider); /// /// See [`CustomCursor`] for more details. #[derive(Debug, Clone, Eq, Hash, PartialEq)] +#[non_exhaustive] pub enum CustomCursorSource { /// Cursor that is backed by RGBA image. /// @@ -167,6 +168,7 @@ impl CustomCursorSource { /// An error produced when using [`CustomCursorSource::from_rgba`] with invalid arguments. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +#[non_exhaustive] pub enum BadImage { /// Produced when the image dimensions are larger than [`MAX_CURSOR_SIZE`]. This doesn't /// guarantee that the cursor will work, but should avoid many platform and device specific @@ -217,6 +219,7 @@ impl Error for BadImage {} /// An error produced when using [`CustomCursorSource::from_animation`] with invalid arguments. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +#[non_exhaustive] pub enum BadAnimation { /// Produced when no cursors were supplied. Empty, diff --git a/winit-core/src/data_transfer.rs b/winit-core/src/data_transfer.rs index 96b060669..c70be7946 100644 --- a/winit-core/src/data_transfer.rs +++ b/winit-core/src/data_transfer.rs @@ -127,6 +127,7 @@ impl DataTransferId { /// The set of types supported cross-platform. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +#[non_exhaustive] pub enum TypeHint { /// Plain UTF-8 text (see [`TypedData::try_as_string`]). /// @@ -381,6 +382,7 @@ impl_dyn_casting!(DataTransfer); /// different encoding on different platforms. To allow this to be represented, we allow /// supplying strings and URIs separately from binary blobs. #[derive(Debug, Clone, PartialEq, Eq, Hash)] +#[non_exhaustive] pub enum SendData { /// List of URIs. /// diff --git a/winit-core/src/event.rs b/winit-core/src/event.rs index 8780d3bda..afc068719 100644 --- a/winit-core/src/event.rs +++ b/winit-core/src/event.rs @@ -20,6 +20,7 @@ use crate::window::{ActivationToken, Theme}; /// Describes the reason the event loop is resuming. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[non_exhaustive] pub enum StartCause { /// Sent if the time specified by [`ControlFlow::WaitUntil`] has been reached. Contains the /// moment the timeout was requested and the requested resume time. The actual resume time is @@ -44,6 +45,7 @@ pub enum StartCause { /// Describes an event from a [`Window`]. #[derive(Debug, Clone, PartialEq)] +#[non_exhaustive] pub enum WindowEvent { /// The activation token was delivered back and now could be used. ActivationTokenDone { serial: AsyncRequestSerial, token: ActivationToken }, @@ -531,6 +533,7 @@ pub enum WindowEvent { /// **Wayland/X11:** [`Unknown`](Self::Unknown) device types are converted to known variants by the /// system. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +#[non_exhaustive] pub enum PointerKind { Mouse, /// See [`PointerSource::Touch`] for more details. @@ -548,6 +551,7 @@ pub enum PointerKind { /// **Wayland/X11:** [`Unknown`](Self::Unknown) device types are converted to known variants by the /// system. #[derive(Clone, Debug, PartialEq)] +#[non_exhaustive] pub enum PointerSource { Mouse, /// Represents a touch event. @@ -616,6 +620,7 @@ impl From for PointerKind { /// **Wayland/X11:** [`Unknown`](Self::Unknown) device types are converted to known variants by the /// system. #[derive(Clone, Debug, PartialEq)] +#[non_exhaustive] pub enum ButtonSource { /// ## Platform-specific /// @@ -730,6 +735,7 @@ impl FingerId { /// /// [window events]: WindowEvent #[derive(Clone, Copy, Debug, PartialEq)] +#[non_exhaustive] pub enum DeviceEvent { /// Change in physical position of a pointing device. /// @@ -1052,6 +1058,7 @@ impl From for Modifiers { /// ``` #[derive(Debug, Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[non_exhaustive] pub enum Ime { /// Notifies when the IME was enabled. /// @@ -1576,6 +1583,7 @@ impl From for Option { /// Describes a difference in the mouse scroll wheel state. #[derive(Debug, Clone, Copy, PartialEq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[non_exhaustive] pub enum MouseScrollDelta { /// Amount in lines or rows to scroll in the horizontal /// and vertical directions. diff --git a/winit-core/src/event_loop/mod.rs b/winit-core/src/event_loop/mod.rs index 06deb1ac6..32988b558 100644 --- a/winit-core/src/event_loop/mod.rs +++ b/winit-core/src/event_loop/mod.rs @@ -282,6 +282,7 @@ impl From for DragIcon { /// are expected to provide some kind of order of preference. #[repr(u8)] #[derive(Debug, Clone, Copy, PartialEq)] +#[non_exhaustive] pub enum DndAction { /// Move the dragged item from the source to the destination. /// diff --git a/winit-core/src/icon.rs b/winit-core/src/icon.rs index 115b259c6..1d943fc1d 100644 --- a/winit-core/src/icon.rs +++ b/winit-core/src/icon.rs @@ -26,6 +26,7 @@ impl_dyn_casting!(IconProvider); #[derive(Debug)] /// An error produced when using [`RgbaIcon::new`] with invalid arguments. +#[non_exhaustive] pub enum BadIcon { /// Produced when the length of the `rgba` argument isn't divisible by 4, thus `rgba` can't be /// safely interpreted as 32bpp RGBA pixels. diff --git a/winit-core/src/keyboard.rs b/winit-core/src/keyboard.rs index f686e3a3a..652165686 100644 --- a/winit-core/src/keyboard.rs +++ b/winit-core/src/keyboard.rs @@ -19,6 +19,7 @@ pub use smol_str::SmolStr; /// - On non-Web platforms, support assigning keybinds to virtually any key through a UI. #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[non_exhaustive] pub enum NativeKeyCode { Unidentified, /// An Android "scancode". @@ -78,6 +79,7 @@ impl std::fmt::Debug for NativeKeyCode { /// define keybinds which work in the presence of identifiers we haven't mapped for you yet. #[derive(Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[non_exhaustive] pub enum NativeKey { Unidentified, /// An Android "keycode", which is similar to a "virtual-key code" on Windows. diff --git a/winit-core/src/monitor.rs b/winit-core/src/monitor.rs index d5a68cb41..b100710c7 100644 --- a/winit-core/src/monitor.rs +++ b/winit-core/src/monitor.rs @@ -183,6 +183,7 @@ impl fmt::Display for VideoMode { /// Fullscreen modes. #[derive(Clone, Debug, PartialEq, Eq)] +#[non_exhaustive] pub enum Fullscreen { Exclusive(MonitorHandle, VideoMode), diff --git a/winit-core/src/window.rs b/winit-core/src/window.rs index 44e3eddba..70992abc0 100644 --- a/winit-core/src/window.rs +++ b/winit-core/src/window.rs @@ -1756,6 +1756,7 @@ bitflags! { } #[derive(Debug, PartialEq, Eq, Clone, Hash)] +#[non_exhaustive] pub enum ImeSurroundingTextError { /// Text exceeds 4000 bytes TextTooLong, @@ -1868,6 +1869,7 @@ impl ImeSurroundingText { /// Request to send to IME. #[derive(Debug, PartialEq, Clone)] +#[non_exhaustive] pub enum ImeRequest { /// Enable the IME with the [`ImeCapabilities`] and [`ImeRequestData`] as initial state. When /// the [`ImeRequestData`] is **not** matching capabilities fully, the default values will be diff --git a/winit-orbital/src/window.rs b/winit-orbital/src/window.rs index cc4fe4e19..fdb5b00d1 100644 --- a/winit-orbital/src/window.rs +++ b/winit-orbital/src/window.rs @@ -342,6 +342,7 @@ impl CoreWindow for Window { None => { let _ = self.set_flag(ORBITAL_FLAG_FULLSCREEN, false); }, + Some(_) => (), } } diff --git a/winit-uikit/src/window.rs b/winit-uikit/src/window.rs index bd2e77657..ca1be8501 100644 --- a/winit-uikit/src/window.rs +++ b/winit-uikit/src/window.rs @@ -323,9 +323,7 @@ impl Inner { Some(Fullscreen::Borderless(Some(monitor))) => { monitor.cast_ref::().unwrap().ui_screen(mtm).clone() }, - Some(Fullscreen::Borderless(None)) => { - self.current_monitor_inner().ui_screen(mtm).clone() - }, + Some(_) => self.current_monitor_inner().ui_screen(mtm).clone(), None => { warn!("`Window::set_fullscreen(None)` ignored on iOS"); return; @@ -405,6 +403,7 @@ impl Inner { *current_caps = None; self.view.resignFirstResponder(); }, + _ => return Err(ImeRequestError::NotSupported), } Ok(()) @@ -522,7 +521,7 @@ impl Window { let monitor = monitor.cast_ref::().unwrap(); monitor.ui_screen(mtm) }, - Some(Fullscreen::Borderless(None)) | None => &main_screen, + _ => &main_screen, }; let screen_bounds = screen.bounds(); diff --git a/winit-wayland/src/dnd.rs b/winit-wayland/src/dnd.rs index 13b164d1c..7620c0901 100644 --- a/winit-wayland/src/dnd.rs +++ b/winit-wayland/src/dnd.rs @@ -85,6 +85,7 @@ impl DataSourceHandler for WinitState { }, }, SendData::Bytes(binary) => Cursor::new(binary), + _ => return, }; let _ = self.loop_handle.insert_source(fd, move |_, file, _| { diff --git a/winit-wayland/src/event_loop/mod.rs b/winit-wayland/src/event_loop/mod.rs index ed0f66925..66bd717fd 100644 --- a/winit-wayland/src/event_loop/mod.rs +++ b/winit-wayland/src/event_loop/mod.rs @@ -694,7 +694,7 @@ impl RootActiveEventLoop for ActiveEventLoop { ) -> Result { let cursor_image = match cursor { CustomCursorSource::Image(cursor_image) => cursor_image, - CustomCursorSource::Animation { .. } | CustomCursorSource::Url { .. } => { + _ => { return Err(NotSupportedError::new("unsupported cursor kind").into()); }, }; diff --git a/winit-wayland/src/window/mod.rs b/winit-wayland/src/window/mod.rs index 32e40835f..4f4bcc73f 100644 --- a/winit-wayland/src/window/mod.rs +++ b/winit-wayland/src/window/mod.rs @@ -453,9 +453,6 @@ impl CoreWindow for Window { fn set_fullscreen(&self, fullscreen: Option) { match fullscreen { - Some(Fullscreen::Exclusive(..)) => { - warn!("`Fullscreen::Exclusive` is ignored on Wayland"); - }, Some(Fullscreen::Borderless(monitor)) => { let output = monitor.as_ref().and_then(|monitor| { monitor.cast_ref::().map(|handle| &handle.proxy) @@ -463,6 +460,9 @@ impl CoreWindow for Window { self.window.set_fullscreen(output) }, + Some(_) => { + warn!("this fullscreen mode is ignored on Wayland"); + }, None => self.window.unset_fullscreen(), } } diff --git a/winit-wayland/src/window/state.rs b/winit-wayland/src/window/state.rs index 67fc1d97d..de90a591a 100644 --- a/winit-wayland/src/window/state.rs +++ b/winit-wayland/src/window/state.rs @@ -1269,6 +1269,7 @@ impl WindowState { self.text_input_state = None; true }, + _ => return Err(ImeRequestError::NotSupported), }; // Only one input method may be active per (seat, surface), diff --git a/winit-web/src/cursor.rs b/winit-web/src/cursor.rs index 2bfb5b9dd..fdb6aa76d 100644 --- a/winit-web/src/cursor.rs +++ b/winit-web/src/cursor.rs @@ -54,6 +54,7 @@ impl CustomCursor { true, ) }, + _ => unimplemented!("unknown `CustomCursorSource` variant"), } } diff --git a/winit-web/src/web_sys/event.rs b/winit-web/src/web_sys/event.rs index 076500d45..fd7e58118 100644 --- a/winit-web/src/web_sys/event.rs +++ b/winit-web/src/web_sys/event.rs @@ -153,7 +153,7 @@ pub fn pointer_source(event: &PointerEvent, kind: PointerKind) -> PointerSource PointerSource::TabletTool { kind: tool, data } }, - PointerKind::Unknown => PointerSource::Unknown, + _ => PointerSource::Unknown, } } diff --git a/winit-web/src/web_sys/fullscreen.rs b/winit-web/src/web_sys/fullscreen.rs index d5b9112a3..630554b85 100644 --- a/winit-web/src/web_sys/fullscreen.rs +++ b/winit-web/src/web_sys/fullscreen.rs @@ -88,6 +88,7 @@ pub(crate) fn request_fullscreen( canvas.webkit_request_fullscreen(); } }, + _ => error!("This full screen mode is not supported"), } } diff --git a/winit-web/src/web_sys/pointer.rs b/winit-web/src/web_sys/pointer.rs index 4cade1e9d..7d90bb8ad 100644 --- a/winit-web/src/web_sys/pointer.rs +++ b/winit-web/src/web_sys/pointer.rs @@ -90,7 +90,7 @@ impl PointerHandler { PointerSource::TabletTool { kind, data } => { ButtonSource::TabletTool { kind, button: event::tool_button(button), data } }, - PointerSource::Unknown => ButtonSource::Unknown(button), + _ => ButtonSource::Unknown(button), }; handler( @@ -152,7 +152,7 @@ impl PointerHandler { ButtonSource::TabletTool { kind, button: event::tool_button(button), data } }, - PointerSource::Unknown => ButtonSource::Unknown(button), + _ => ButtonSource::Unknown(button), }; handler( @@ -229,7 +229,7 @@ impl PointerHandler { button: event::tool_button(button), data, }, - PointerSource::Unknown => ButtonSource::Unknown(button), + _ => ButtonSource::Unknown(button), }; button_handler( diff --git a/winit-win32/src/dnd.rs b/winit-win32/src/dnd.rs index f64b99a05..f8690113b 100644 --- a/winit-win32/src/dnd.rs +++ b/winit-win32/src/dnd.rs @@ -247,6 +247,7 @@ impl TypedData for WinTypedData { }, // Windows URI drag-and-drop can't be neatly expressed as a binary blob. SendData::Uris(_) => None, + _ => None, } } @@ -924,6 +925,7 @@ unsafe fn send_data_to_stgmedium(data: SendData, hint: TypeHint) -> Option alloc_hglobal_from(&b)?, + _ => return None, }; let mut medium = unsafe { std::mem::zeroed::() }; diff --git a/winit-win32/src/event_loop.rs b/winit-win32/src/event_loop.rs index af9265b92..e52bf3114 100644 --- a/winit-win32/src/event_loop.rs +++ b/winit-win32/src/event_loop.rs @@ -431,7 +431,7 @@ impl RootActiveEventLoop for ActiveEventLoop { ) -> Result { let cursor = match source { CustomCursorSource::Image(cursor) => cursor, - CustomCursorSource::Animation { .. } | CustomCursorSource::Url { .. } => { + _ => { return Err(NotSupportedError::new("unsupported cursor kind").into()); }, }; @@ -1397,6 +1397,7 @@ unsafe fn public_window_callback_inner( window_pos.cy = old_monitor_rect.bottom - old_monitor_rect.top; } }, + _ => (), } } } diff --git a/winit-win32/src/window.rs b/winit-win32/src/window.rs index 71486fd22..bf78bb369 100644 --- a/winit-win32/src/window.rs +++ b/winit-win32/src/window.rs @@ -967,7 +967,7 @@ impl CoreWindow for Window { | Fullscreen::Borderless(Some(monitor)) => { Some(Cow::Borrowed(monitor.cast_ref::().unwrap())) }, - Fullscreen::Borderless(None) => None, + _ => None, }; let monitor = monitor @@ -1068,7 +1068,8 @@ impl CoreWindow for Window { match &request { ImeRequest::Enable(..) if cap.is_some() => return Err(ImeRequestError::AlreadyEnabled), ImeRequest::Update(_) if cap.is_none() => return Err(ImeRequestError::NotEnabled), - _ => (), + ImeRequest::Enable(..) | ImeRequest::Update(_) | ImeRequest::Disable => (), + _ => return Err(ImeRequestError::NotSupported), } let window = self.window; @@ -1096,6 +1097,7 @@ impl CoreWindow for Window { ImeContext::set_ime_allowed(window.hwnd(), false); return; }, + _ => return, }; if let Some((spot, size)) = request_data.cursor_area { diff --git a/winit-x11/src/util/cursor.rs b/winit-x11/src/util/cursor.rs index af6022576..cf1553456 100644 --- a/winit-x11/src/util/cursor.rs +++ b/winit-x11/src/util/cursor.rs @@ -199,7 +199,7 @@ impl CustomCursor { ) -> Result { let mut cursor = match cursor { CustomCursorSource::Image(cursor_image) => cursor_image, - CustomCursorSource::Animation { .. } | CustomCursorSource::Url { .. } => { + _ => { return Err(NotSupportedError::new("unsupported cursor kind").into()); }, }; diff --git a/winit-x11/src/window.rs b/winit-x11/src/window.rs index 0e0246f42..aae7e8258 100644 --- a/winit-x11/src/window.rs +++ b/winit-x11/src/window.rs @@ -1105,9 +1105,7 @@ impl UnownedWindow { let monitor = monitor.cast_ref::().unwrap(); (Cow::Borrowed(monitor), None) }, - Fullscreen::Borderless(None) => { - (Cow::Owned(self.shared_state_lock().last_monitor.clone()), None) - }, + _ => (Cow::Owned(self.shared_state_lock().last_monitor.clone()), None), }; // Don't set fullscreen on an invalid dummy monitor handle @@ -2144,6 +2142,7 @@ impl UnownedWindow { self.set_ime_allowed(false); return Ok(()); }, + _ => return Err(ImeRequestError::NotSupported), }; if let Some((position, size)) = state.cursor_area { diff --git a/winit/examples/application.rs b/winit/examples/application.rs index 0f213940b..27fb84434 100644 --- a/winit/examples/application.rs +++ b/winit/examples/application.rs @@ -457,6 +457,7 @@ impl ApplicationHandler for Application { MouseScrollDelta::PixelDelta(px) => { info!("Mouse wheel Pixel Delta: ({},{})", px.x, px.y); }, + _ => (), }, WindowEvent::KeyboardInput { event, is_synthetic: false, .. } => { let mods = window.modifiers; diff --git a/winit/examples/ime.rs b/winit/examples/ime.rs index fd1ffbd40..652dac86a 100644 --- a/winit/examples/ime.rs +++ b/winit/examples/ime.rs @@ -248,6 +248,7 @@ impl App { } }, Ime::Disabled => info!("IME disabled for Window={:?}", surface.window().id()), + _ => (), } }