mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-29 04:40:04 -04:00
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).
This commit is contained in:
@@ -199,7 +199,7 @@ impl CustomCursor {
|
||||
) -> Result<CustomCursor, RequestError> {
|
||||
let mut cursor = match cursor {
|
||||
CustomCursorSource::Image(cursor_image) => cursor_image,
|
||||
CustomCursorSource::Animation { .. } | CustomCursorSource::Url { .. } => {
|
||||
_ => {
|
||||
return Err(NotSupportedError::new("unsupported cursor kind").into());
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1105,9 +1105,7 @@ impl UnownedWindow {
|
||||
let monitor = monitor.cast_ref::<X11MonitorHandle>().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 {
|
||||
|
||||
Reference in New Issue
Block a user