From 23be1db1e33125bfa4c04abbaf8ea560415ba367 Mon Sep 17 00:00:00 2001 From: Maxime Nordier Date: Wed, 30 Jul 2025 22:37:36 +0200 Subject: dnd: drop on tablet pen tip up (#11270) --- src/protocols/core/DataDevice.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/protocols/core/DataDevice.cpp') 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 currentSource dropDrag(); }); + m_dnd.tabletTip = g_pHookSystem->hookDynamic("tabletTip", [this](void* self, SCallbackInfo& info, std::any e) { + auto E = std::any_cast(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(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(); -- cgit v1.2.3