diff --git a/TODO.md b/TODO.md index ec27752e..23bc5602 100644 --- a/TODO.md +++ b/TODO.md @@ -8,7 +8,6 @@ - fix HLabeledItem disabled opacity (visible for the topic area in room settings) -- ~~save and restore status message in accounts.json~~ - mark accounts as offline when closing mirage - document new libXScreenSaver-devel dependency (for auto-idle) - retrieve last seen time for offline members on hover/in profile/automatically diff --git a/mirage.pro b/mirage.pro index 530902b2..027ba27e 100644 --- a/mirage.pro +++ b/mirage.pro @@ -36,6 +36,7 @@ unix:!macx { # Custom CONFIG options dev { + # Enable debugging and don't use the Qt Resource System to compile faster CONFIG -= warn_off release CONFIG += debug qml_debug declarative_debug RESOURCES -= $$QRC_FILE @@ -43,6 +44,12 @@ dev { warning(make install cannot be used with the dev CONFIG option.) } +no-x11 { + # Compile without X11-specific features (auto-away) + DEFINES += NO_X11 + LIBS -= -lX11 -lXss +} + # Files to copy for `make install` diff --git a/src/gui/IdleManager.qml b/src/gui/IdleManager.qml index 046df980..94d434b3 100644 --- a/src/gui/IdleManager.qml +++ b/src/gui/IdleManager.qml @@ -14,8 +14,10 @@ Timer { interval: 1000 - running: window.settings.beUnavailableAfterSecondsIdle > 0 repeat: true + running: + window.settings.beUnavailableAfterSecondsIdle > 0 && + CppUtils.idleMilliseconds() !== -1 onTriggered: { let changes = false diff --git a/src/main.cpp b/src/main.cpp index f12d0a7b..23737013 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #ifdef Q_OS_UNIX #include diff --git a/src/utils.h b/src/utils.h index 004bd52b..ee4d52cd 100644 --- a/src/utils.h +++ b/src/utils.h @@ -12,7 +12,10 @@ #include #ifdef Q_OS_UNIX -#include + #ifndef NO_X11 + #define USE_UNIX_AUTOAWAY + #include + #endif #endif #include "../submodules/hsluv-c/src/hsluv.h" @@ -51,7 +54,7 @@ public slots: #ifdef Q_OS_DARWIN return -1; - #elif defined(Q_OS_UNIX) + #elif defined(USE_UNIX_AUTOAWAY) Display *display = XOpenDisplay(NULL); if (! display) return -1;