input: abord dnd op on escape pressed

ref #9154
This commit is contained in:
Vaxry
2025-01-24 13:37:23 +00:00
parent 944e36ea2e
commit 57a39984dd
3 changed files with 13 additions and 0 deletions

View File

@@ -814,3 +814,9 @@ void CWLDataDeviceProtocol::renderDND(PHLMONITOR pMonitor, timespec* when) {
bool CWLDataDeviceProtocol::dndActive() {
return dnd.currentSource;
}
void CWLDataDeviceProtocol::abortDndIfPresent() {
if (!dndActive())
return;
abortDrag();
}

View File

@@ -144,6 +144,9 @@ class CWLDataDeviceProtocol : public IWaylandProtocol {
// TODO: move handling to seatmgr
bool dndActive();
// called on an escape key pressed, for moments where it gets stuck
void abortDndIfPresent();
private:
void destroyResource(CWLDataDeviceManagerResource* resource);
void destroyResource(CWLDataDeviceResource* resource);