mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-08-16 16:50:23 +03: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
@ -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 New Issue
Block a user