From a1847f77f143d3ebc20f9c8a6802843424da35dd Mon Sep 17 00:00:00 2001
From: Xaver Hugl <xaver.hugl@gmail.com>
Date: Wed, 7 Jul 2021 21:02:43 +0200
Subject: [PATCH] platforms/drm: only show cursor on dpms on if not hidden

While always calling showCursor isn't a problem for when there's no
pointing device as the cursor image is empty in that case, it can
cause a temporarily stuck cursor image when it's supposed to be
hidden because of touch input
---
 src/plugins/platforms/drm/drm_output.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/plugins/platforms/drm/drm_output.cpp b/src/plugins/platforms/drm/drm_output.cpp
index 4af3bde5c5..92ee5012c3 100644
--- a/src/plugins/platforms/drm/drm_output.cpp
+++ b/src/plugins/platforms/drm/drm_output.cpp
@@ -429,7 +429,9 @@ void DrmOutput::dpmsFinishOn()
     if (Compositor *compositor = Compositor::self()) {
         compositor->addRepaintFull();
     }
-    showCursor();
+    if (!m_backend->isCursorHidden()) {
+        showCursor();
+    }
 }
 
 void DrmOutput::dpmsFinishOff()