From 6b9faab87bea9cebec6ae036906fd67fed254f5f Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Fri, 27 Dec 2024 15:57:12 -0800 Subject: [PATCH] dnd: Don't call `Arc::get_mut` The caller of `start_dnd` may also have a reference, so this can panic. Either the public API shouldn't take an `Arc` or this should be avoided. There doesn't seem to be any reason this is needed anyway. --- dnd/src/platform/linux.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/dnd/src/platform/linux.rs b/dnd/src/platform/linux.rs index abafb4b..31a1879 100644 --- a/dnd/src/platform/linux.rs +++ b/dnd/src/platform/linux.rs @@ -45,13 +45,7 @@ impl AsMimeTypes for DataWrapper { impl smithay_clipboard::dnd::RawSurface for DndSurface { unsafe fn get_ptr(&mut self) -> *mut c_void { - // XXX won't panic because this is only called once before it could be - // cloned - Arc::get_mut(&mut self.0) - .unwrap() - .window_handle() - .unwrap() - .get_ptr() + self.0.window_handle().unwrap().get_ptr() } }