From 8a1c65efe59f72216b27576ace11a19b73e82dd1 Mon Sep 17 00:00:00 2001 From: valadaptive Date: Fri, 10 Jan 2025 10:58:38 -0500 Subject: [PATCH] x11: don't emit DragLeave without DragEnter --- src/platform_impl/linux/x11/event_processor.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/platform_impl/linux/x11/event_processor.rs b/src/platform_impl/linux/x11/event_processor.rs index b7a1a634a40..6e4c1e26c0d 100644 --- a/src/platform_impl/linux/x11/event_processor.rs +++ b/src/platform_impl/linux/x11/event_processor.rs @@ -560,9 +560,11 @@ impl EventProcessor { } if xev.message_type == atoms[XdndLeave] as c_ulong { + if self.dnd.has_entered { + let event = Event::WindowEvent { window_id, event: WindowEvent::DragLeave }; + callback(&self.target, event); + } self.dnd.reset(); - let event = Event::WindowEvent { window_id, event: WindowEvent::DragLeave }; - callback(&self.target, event); } }