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();