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
This commit is contained in:
Vlad Zahorodnii 2024-05-31 11:56:15 +03:00
parent 1c3a987d74
commit ee4cf67371

View file

@ -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;