summaryrefslogtreecommitdiff
path: root/src/protocols/core/DataDevice.cpp
diff options
context:
space:
mode:
authorMaxime Nordier <darkcreepy59@gmail.com>2025-07-30 22:37:36 +0200
committerGitHub <noreply@github.com>2025-07-30 22:37:36 +0200
commit23be1db1e33125bfa4c04abbaf8ea560415ba367 (patch)
tree63e5decaa6e09cc910227dbe62431ef9969734fd /src/protocols/core/DataDevice.cpp
parentf309d860035373e6d1473142865fb8a39923f01f (diff)
dnd: drop on tablet pen tip up (#11270)
Diffstat (limited to 'src/protocols/core/DataDevice.cpp')
-rw-r--r--src/protocols/core/DataDevice.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp
index 0ede65ed..254a55a3 100644
--- a/src/protocols/core/DataDevice.cpp
+++ b/src/protocols/core/DataDevice.cpp
@@ -591,6 +591,14 @@ void CWLDataDeviceProtocol::initiateDrag(WP<CWLDataSourceResource> currentSource
dropDrag();
});
+ m_dnd.tabletTip = g_pHookSystem->hookDynamic("tabletTip", [this](void* self, SCallbackInfo& info, std::any e) {
+ auto E = std::any_cast<CTablet::STipEvent>(e);
+ if (!E.in) {
+ LOGM(LOG, "Dropping drag on tablet tipUp");
+ dropDrag();
+ }
+ });
+
m_dnd.mouseMove = g_pHookSystem->hookDynamic("mouseMove", [this](void* self, SCallbackInfo& info, std::any e) {
auto V = std::any_cast<const Vector2D>(e);
if (m_dnd.focusedDevice && g_pSeatManager->m_state.dndPointerFocus) {
@@ -695,6 +703,7 @@ void CWLDataDeviceProtocol::cleanupDndState(bool resetDevice, bool resetSource,
m_dnd.mouseMove.reset();
m_dnd.touchUp.reset();
m_dnd.touchMove.reset();
+ m_dnd.tabletTip.reset();
if (resetDevice)
m_dnd.focusedDevice.reset();