mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-15 20:13:49 -07: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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user