From c2141dc4efac6e7c51815aa57272b5537e60f101 Mon Sep 17 00:00:00 2001 From: David Redondo Date: Thu, 13 Jun 2024 16:53:23 +0200 Subject: [PATCH] Also wake up screens on tablet interactions BUG:451359 FIXED-IN:6.1.1 --- src/dpmsinputeventfilter.cpp | 37 ++++++++++++++++++++++++++++++++++++ src/dpmsinputeventfilter.h | 5 +++++ 2 files changed, 42 insertions(+) diff --git a/src/dpmsinputeventfilter.cpp b/src/dpmsinputeventfilter.cpp index b6314c3c9c..7dbaed8d0d 100644 --- a/src/dpmsinputeventfilter.cpp +++ b/src/dpmsinputeventfilter.cpp @@ -129,6 +129,43 @@ bool DpmsInputEventFilter::touchMotion(qint32 id, const QPointF &pos, std::chron return true; } +bool DpmsInputEventFilter::tabletToolEvent(TabletEvent *event) +{ + if (event->type() == QEvent::TabletPress) { + // Only wake when the tool is actually pressed down not just hovered over the tablet + notify(); + } + return true; +} + +bool DpmsInputEventFilter::tabletToolButtonEvent(uint button, bool pressed, const TabletToolId &tabletToolId, std::chrono::microseconds time) +{ + if (pressed) { + notify(); + } + return true; +} + +bool DpmsInputEventFilter::tabletPadButtonEvent(uint button, bool pressed, const TabletPadId &tabletPadId, std::chrono::microseconds time) +{ + if (pressed) { + notify(); + } + return true; +} + +bool DpmsInputEventFilter::tabletPadStripEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, std::chrono::microseconds time) +{ + notify(); + return true; +} + +bool DpmsInputEventFilter::tabletPadRingEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, std::chrono::microseconds time) +{ + notify(); + return true; +} + void DpmsInputEventFilter::notify() { const QList outputs = workspace()->outputs(); diff --git a/src/dpmsinputeventfilter.h b/src/dpmsinputeventfilter.h index 461a040e4b..6cb28bd069 100644 --- a/src/dpmsinputeventfilter.h +++ b/src/dpmsinputeventfilter.h @@ -32,6 +32,11 @@ public: bool touchDown(qint32 id, const QPointF &pos, std::chrono::microseconds time) override; bool touchMotion(qint32 id, const QPointF &pos, std::chrono::microseconds time) override; bool touchUp(qint32 id, std::chrono::microseconds time) override; + bool tabletToolEvent(TabletEvent *event) override; + bool tabletToolButtonEvent(uint button, bool pressed, const TabletToolId &tabletToolId, std::chrono::microseconds time) override; + bool tabletPadButtonEvent(uint button, bool pressed, const TabletPadId &tabletPadId, std::chrono::microseconds time) override; + bool tabletPadStripEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, std::chrono::microseconds time) override; + bool tabletPadRingEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, std::chrono::microseconds time) override; private: void notify();