mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 06:49:49 +01:00
data-device: properly abort drag on missing device
sometimes there is no focused device (e.g. when dnd'ing on nothing or xwayland) in which case abort would fail to send cancelled to the source. ref #6543
This commit is contained in:
parent
172ee1cada
commit
d5ef10abf4
1 changed files with 5 additions and 3 deletions
|
@ -644,11 +644,13 @@ void CWLDataDeviceProtocol::abortDrag() {
|
|||
g_pInputManager->unsetCursorImage();
|
||||
dnd.overriddenCursor = false;
|
||||
|
||||
if (!dnd.focusedDevice || !dnd.currentSource)
|
||||
if (!dnd.focusedDevice && !dnd.currentSource)
|
||||
return;
|
||||
|
||||
dnd.focusedDevice->sendLeave();
|
||||
dnd.currentSource->cancelled();
|
||||
if (dnd.focusedDevice)
|
||||
dnd.focusedDevice->sendLeave();
|
||||
if (dnd.currentSource)
|
||||
dnd.currentSource->cancelled();
|
||||
|
||||
dnd.focusedDevice.reset();
|
||||
dnd.currentSource.reset();
|
||||
|
|
Loading…
Reference in a new issue