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
wilder/Plasma/6.2
Vlad Zahorodnii 2 years ago
parent 1c3a987d74
commit ee4cf67371
  1. 4
      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;

Loading…
Cancel
Save