linux: Use D-Bus to inhibit screensaver

This commit is contained in:
robxnano 2024-09-23 17:51:04 +01:00
commit 2748771cb3
No known key found for this signature in database
GPG key ID: 9FB6B03B782D1E42
9 changed files with 229 additions and 41 deletions

View file

@ -50,8 +50,8 @@
#include "UICommon/DiscordPresence.h"
#include "UICommon/USBUtils.h"
#ifdef HAVE_X11
#include "UICommon/X11Utils.h"
#ifdef HAVE_QTDBUS
#include "UICommon/DBusUtils.h"
#endif
#ifdef __APPLE__
@ -480,17 +480,13 @@ bool TriggerSTMPowerEvent()
return true;
}
#ifdef HAVE_X11
void InhibitScreenSaver(Window win, bool inhibit)
#else
void InhibitScreenSaver(bool inhibit)
#endif
{
// Inhibit the screensaver. Depending on the operating system this may also
// disable low-power states and/or screen dimming.
#ifdef HAVE_X11
X11Utils::InhibitScreensaver(win, inhibit);
#ifdef HAVE_QTDBUS
DBusUtils::InhibitScreenSaver(inhibit);
#endif
#ifdef _WIN32