Make libX11 & libXScrnSaver optional on Linux

This commit is contained in:
miruka 2020-07-16 19:09:09 -04:00
parent 15de44f47a
commit abcea2244d
5 changed files with 16 additions and 4 deletions

View File

@ -8,7 +8,6 @@
- fix HLabeledItem disabled opacity - fix HLabeledItem disabled opacity
(visible for the topic area in room settings) (visible for the topic area in room settings)
- ~~save and restore status message in accounts.json~~
- mark accounts as offline when closing mirage - mark accounts as offline when closing mirage
- document new libXScreenSaver-devel dependency (for auto-idle) - document new libXScreenSaver-devel dependency (for auto-idle)
- retrieve last seen time for offline members on hover/in profile/automatically - retrieve last seen time for offline members on hover/in profile/automatically

View File

@ -36,6 +36,7 @@ unix:!macx {
# Custom CONFIG options # Custom CONFIG options
dev { dev {
# Enable debugging and don't use the Qt Resource System to compile faster
CONFIG -= warn_off release CONFIG -= warn_off release
CONFIG += debug qml_debug declarative_debug CONFIG += debug qml_debug declarative_debug
RESOURCES -= $$QRC_FILE RESOURCES -= $$QRC_FILE
@ -43,6 +44,12 @@ dev {
warning(make install cannot be used with the dev CONFIG option.) 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` # Files to copy for `make install`

View File

@ -14,8 +14,10 @@ Timer {
interval: 1000 interval: 1000
running: window.settings.beUnavailableAfterSecondsIdle > 0
repeat: true repeat: true
running:
window.settings.beUnavailableAfterSecondsIdle > 0 &&
CppUtils.idleMilliseconds() !== -1
onTriggered: { onTriggered: {
let changes = false let changes = false

View File

@ -12,6 +12,7 @@
#include <QQuickStyle> #include <QQuickStyle>
#include <QFontDatabase> #include <QFontDatabase>
#include <QDateTime> #include <QDateTime>
#include <QDebug>
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
#include <unistd.h> #include <unistd.h>

View File

@ -12,7 +12,10 @@
#include <QUuid> #include <QUuid>
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
#include <X11/extensions/scrnsaver.h> #ifndef NO_X11
#define USE_UNIX_AUTOAWAY
#include <X11/extensions/scrnsaver.h>
#endif
#endif #endif
#include "../submodules/hsluv-c/src/hsluv.h" #include "../submodules/hsluv-c/src/hsluv.h"
@ -51,7 +54,7 @@ public slots:
#ifdef Q_OS_DARWIN #ifdef Q_OS_DARWIN
return -1; return -1;
#elif defined(Q_OS_UNIX) #elif defined(USE_UNIX_AUTOAWAY)
Display *display = XOpenDisplay(NULL); Display *display = XOpenDisplay(NULL);
if (! display) return -1; if (! display) return -1;