runtime: Remove start_dnd

This is not currently used. And is impossible to (soundly) use, since it
requires a `Send` bound, which `State` and `Element` lack.
This commit is contained in:
Ian Douglas Scott 2025-01-03 14:21:35 -08:00 committed by Ashley Wulber
parent bd6c04d809
commit ed5de12e69
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
3 changed files with 2 additions and 52 deletions

2
Cargo.lock generated
View file

@ -3218,11 +3218,13 @@ dependencies = [
"mundy",
"raw-window-handle",
"rustc-hash 2.1.1",
"rustix 0.38.44",
"sysinfo",
"thiserror 2.0.17",
"tracing",
"wasm-bindgen-futures",
"wayland-backend",
"wayland-client",
"wayland-protocols 0.32.9",
"web-sys",
"winapi",

View file

@ -17,19 +17,6 @@ pub enum DndAction {
/// The rectangles to register.
rectangles: Vec<DndDestinationRectangle>,
},
/// Start a Dnd operation.
StartDnd {
/// Whether the Dnd operation is internal.
internal: bool,
/// The source surface of the Dnd operation.
source_surface: Option<DndSource>,
/// The icon surface of the Dnd operation.
icon_surface: Option<Box<dyn Any + Send>>,
/// The content of the Dnd operation.
content: Box<dyn AsMimeTypes + Send + 'static>,
/// The actions of the Dnd operation.
actions: dnd::DndAction,
},
/// End a Dnd operation.
EndDnd,
/// Peek the current Dnd operation.
@ -53,19 +40,6 @@ impl std::fmt::Debug for DndAction {
.field("surface", surface)
.field("rectangles", rectangles)
.finish(),
Self::StartDnd {
internal,
source_surface,
icon_surface,
content: _,
actions,
} => f
.debug_struct("StartDnd")
.field("internal", internal)
.field("source_surface", source_surface)
.field("icon_surface", icon_surface)
.field("actions", actions)
.finish(),
Self::EndDnd => f.write_str("EndDnd"),
Self::PeekDnd(mime, _) => {
f.debug_struct("PeekDnd").field("mime", mime).finish()
@ -99,23 +73,6 @@ pub fn register_dnd_destination<Message>(
}))
}
/// Start a Dnd operation.
pub fn start_dnd<Message>(
internal: bool,
source_surface: Option<DndSource>,
icon_surface: Option<Box<dyn Any + Send>>,
content: Box<dyn AsMimeTypes + Send + 'static>,
actions: dnd::DndAction,
) -> Task<Message> {
task::effect(Action::Dnd(DndAction::StartDnd {
internal,
source_surface,
icon_surface,
content,
actions,
}))
}
/// End a Dnd operation.
pub fn end_dnd<Message>() -> Task<Message> {
task::effect(Action::Dnd(DndAction::EndDnd))

View file

@ -2170,15 +2170,6 @@ where
iced_runtime::dnd::DndAction::SetAction(a) => {
clipboard.set_action(a);
}
iced_runtime::dnd::DndAction::StartDnd {
internal,
source_surface,
icon_surface,
content,
actions,
} => {
// removed
}
},
Action::PlatformSpecific(a) => {
platform_specific.send_action(a);