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
(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

View File

@ -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`

View File

@ -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

View File

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

View File

@ -12,8 +12,11 @@
#include <QUuid>
#ifdef Q_OS_UNIX
#ifndef NO_X11
#define USE_UNIX_AUTOAWAY
#include <X11/extensions/scrnsaver.h>
#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;