From 9ef13c9d502196d5f5b96f3892b3591737c74823 Mon Sep 17 00:00:00 2001 From: miruka Date: Sat, 7 Nov 2020 04:47:09 -0400 Subject: [PATCH] idleMilliseconds: return -1 if WAYLAND_DISPLAY set CppUtils.idleMilliseconds(): If the WAYLAND_DISPLAY environment variable is set, assume we're running under a Wayland environment and return early before trying to connect to an X11 display. --- src/utils.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils.h b/src/utils.h index ffe14192..05dc9ad5 100644 --- a/src/utils.h +++ b/src/utils.h @@ -62,6 +62,8 @@ public slots: return -1; #elif defined(USE_LINUX_AUTOAWAY) + if (! this->waylandDisplay.isEmpty()) return -1; + Display *display = XOpenDisplay(NULL); if (! display) return -1; @@ -88,6 +90,7 @@ public slots: private: QLocale appLocale; + QString waylandDisplay = qEnvironmentVariable("WAYLAND_DISPLAY"); };