diff options
Diffstat (limited to 'src/protocols')
| -rw-r--r-- | src/protocols/core/DataDevice.cpp | 9 | ||||
| -rw-r--r-- | src/protocols/core/DataDevice.hpp | 1 |
2 files changed, 10 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(); diff --git a/src/protocols/core/DataDevice.hpp b/src/protocols/core/DataDevice.hpp index d54927d2..8b52933e 100644 --- a/src/protocols/core/DataDevice.hpp +++ b/src/protocols/core/DataDevice.hpp @@ -180,6 +180,7 @@ class CWLDataDeviceProtocol : public IWaylandProtocol { SP<HOOK_CALLBACK_FN> mouseButton; SP<HOOK_CALLBACK_FN> touchUp; SP<HOOK_CALLBACK_FN> touchMove; + SP<HOOK_CALLBACK_FN> tabletTip; } m_dnd; void abortDrag(); |
