summaryrefslogtreecommitdiff
path: root/src/protocols/core/DataDevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocols/core/DataDevice.cpp')
-rw-r--r--src/protocols/core/DataDevice.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp
index 2d50ff15..9634d569 100644
--- a/src/protocols/core/DataDevice.cpp
+++ b/src/protocols/core/DataDevice.cpp
@@ -540,7 +540,7 @@ void CWLDataDeviceProtocol::initiateDrag(WP<CWLDataSourceResource> currentSource
}
void CWLDataDeviceProtocol::updateDrag() {
- if (!dnd.currentSource)
+ if (!dndActive())
return;
if (dnd.focusedDevice)
@@ -595,15 +595,13 @@ void CWLDataDeviceProtocol::dropDrag() {
}
dnd.focusedDevice->sendDrop();
+ dnd.focusedDevice->sendLeave();
resetDndState();
if (dnd.overriddenCursor)
g_pInputManager->unsetCursorImage();
dnd.overriddenCursor = false;
-
- g_pInputManager->simulateMouseMovement();
- g_pSeatManager->resendEnterEvents();
}
bool CWLDataDeviceProtocol::wasDragSuccessful() {
@@ -624,11 +622,13 @@ bool CWLDataDeviceProtocol::wasDragSuccessful() {
void CWLDataDeviceProtocol::completeDrag() {
resetDndState();
- if (!dnd.focusedDevice || !dnd.currentSource)
+ if (!dnd.focusedDevice && !dnd.currentSource)
return;
- dnd.currentSource->sendDndDropPerformed();
- dnd.currentSource->sendDndFinished();
+ if (dnd.currentSource) {
+ dnd.currentSource->sendDndDropPerformed();
+ dnd.currentSource->sendDndFinished();
+ }
dnd.focusedDevice.reset();
dnd.currentSource.reset();