From 94381e59991824ab9a5a9cb5fe701181fbcbc81d Mon Sep 17 00:00:00 2001 From: vaxerski Date: Thu, 2 Jan 2025 15:58:28 +0100 Subject: [PATCH] dnd/seat: avoid sending button events during a dnd op fixes #8781 --- src/managers/SeatManager.cpp | 2 +- src/protocols/core/DataDevice.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/managers/SeatManager.cpp b/src/managers/SeatManager.cpp index b169faeb..3b9a4925 100644 --- a/src/managers/SeatManager.cpp +++ b/src/managers/SeatManager.cpp @@ -281,7 +281,7 @@ void CSeatManager::sendPointerMotion(uint32_t timeMs, const Vector2D& local) { } void CSeatManager::sendPointerButton(uint32_t timeMs, uint32_t key, wl_pointer_button_state state_) { - if (!state.pointerFocusResource) + if (!state.pointerFocusResource || PROTO::data->dndActive()) return; for (auto const& s : seatResources) { diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp index 9fc49a44..6ad17d7b 100644 --- a/src/protocols/core/DataDevice.cpp +++ b/src/protocols/core/DataDevice.cpp @@ -808,5 +808,5 @@ void CWLDataDeviceProtocol::renderDND(PHLMONITOR pMonitor, timespec* when) { } bool CWLDataDeviceProtocol::dndActive() { - return dnd.currentSource && dnd.mouseButton /* test a member of the state to ensure it's also present */; + return dnd.currentSource; }