From 5da78ce971c8685666391756c883544870b559ef Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Fri, 14 Jun 2024 18:51:44 +0200 Subject: [PATCH] wayland: send drop event unconditionally on drop The chromium DnD code has been fucked for a long time and starting in 126 the whole tab freezes if a drop is started and ended within the same tabe. This commit fixes this issue and it seems to also not break any other applications. --- src/ifs/wl_seat/pointer_owner.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ifs/wl_seat/pointer_owner.rs b/src/ifs/wl_seat/pointer_owner.rs index 23914c98..ed815ce5 100644 --- a/src/ifs/wl_seat/pointer_owner.rs +++ b/src/ifs/wl_seat/pointer_owner.rs @@ -464,6 +464,8 @@ impl PointerOwner for DndPointerOwner { if button != self.button || state != KeyState::Released { return; } + let target = self.target.get(); + target.node_on_dnd_drop(&self.dnd); if let Some(src) = &self.dnd.src { src.on_drop(seat); } @@ -471,9 +473,7 @@ impl PointerOwner for DndPointerOwner { None => true, Some(s) => s.can_drop(), }; - let target = self.target.get(); if should_drop { - self.target.get().node_on_dnd_drop(&self.dnd); *seat.dropped_dnd.borrow_mut() = Some(DroppedDnd { dnd: self.dnd.clone(), });