Force cancel of any drag in progress when Escape is pressed

when escape is pressed when dragging between different clients,
cancelling any drag is compositor's responsibility

BUG:405267
This commit is contained in:
Marco Martin 2022-03-03 09:54:18 +00:00
parent d789ecc6d1
commit e00d836708

View file

@ -2240,6 +2240,22 @@ public:
}
return true;
}
bool keyEvent(QKeyEvent *event)
{
if (event->key() != Qt::Key_Escape) {
return false;
}
auto seat = waylandServer()->seat();
if (!seat->isDrag()) {
return false;
}
seat->setTimestamp(event->timestamp());
seat->cancelDrag();
return true;
}
private:
void raiseDragTarget()
{