From ee4cf67371fb9b1047f50b6d40ac84fe19bf1b11 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 31 May 2024 11:56:15 +0300 Subject: [PATCH] wayland: Refuse starting dnd if there's another dnd session in progress If a new drag and drop session is started while there is already one existing, it's possible to end up in a situation where the SeatInterface::dragEnded signal is emitted the second time when one of the data sources is destroyed. CCBUG: 460374 --- src/wayland/seat.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wayland/seat.cpp b/src/wayland/seat.cpp index 1b854d7993..6a15964bd3 100644 --- a/src/wayland/seat.cpp +++ b/src/wayland/seat.cpp @@ -1352,6 +1352,10 @@ void SeatInterface::setPrimarySelection(AbstractDataSource *selection) void SeatInterface::startDrag(AbstractDataSource *dragSource, SurfaceInterface *originSurface, int dragSerial, DragAndDropIcon *dragIcon) { + if (d->drag.mode != SeatInterfacePrivate::Drag::Mode::None) { + return; + } + if (hasImplicitPointerGrab(dragSerial)) { d->drag.mode = SeatInterfacePrivate::Drag::Mode::Pointer; d->drag.transformation = d->globalPointer.focus.transformation;