From b24fc72969cea7ef55eeaf6d258c42b9759e1eb8 Mon Sep 17 00:00:00 2001 From: Bhushan Shah Date: Mon, 22 Feb 2021 21:13:41 +0530 Subject: [PATCH] [platforms/drm] only enable output on key press not release Otherwise if powerdevil for example is configured to turn screen off on the power key press, we will turn it right back on when we get key release event. Suggested-by: David Edmundson --- src/plugins/platforms/drm/drm_inputeventfilter.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/drm/drm_inputeventfilter.cpp b/src/plugins/platforms/drm/drm_inputeventfilter.cpp index 933fe1a87c..9744fb3480 100644 --- a/src/plugins/platforms/drm/drm_inputeventfilter.cpp +++ b/src/plugins/platforms/drm/drm_inputeventfilter.cpp @@ -42,9 +42,11 @@ bool DpmsInputEventFilter::wheelEvent(QWheelEvent *event) bool DpmsInputEventFilter::keyEvent(QKeyEvent *event) { - Q_UNUSED(event) - notify(); - return true; + if (event->type() == QKeyEvent::KeyPress) { + notify(); + return true; + } + return false; } bool DpmsInputEventFilter::touchDown(qint32 id, const QPointF &pos, quint32 time)