mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
macOS: fix panic during drag_window
Return error from it instead of unwrapping.
This commit is contained in:
committed by
Kirill Chibisov
parent
107bf91a2d
commit
485ae90aae
@@ -1163,7 +1163,8 @@ impl WindowDelegate {
|
||||
#[inline]
|
||||
pub fn drag_window(&self) -> Result<(), ExternalError> {
|
||||
let mtm = MainThreadMarker::from(self);
|
||||
let event = NSApplication::sharedApplication(mtm).currentEvent().unwrap();
|
||||
let event =
|
||||
NSApplication::sharedApplication(mtm).currentEvent().ok_or(ExternalError::Ignored)?;
|
||||
self.window().performWindowDragWithEvent(&event);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user