Skip to content

Commit e2094bb

Browse files
committed
Include QtDbus on MacOS but don't use native macOS wake sleep functionality instead of DBus
1 parent 8510c2b commit e2094bb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

gui/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ if(CHIAKI_ENABLE_CLI)
9696
endif()
9797

9898
target_link_libraries(chiaki Qt::Core Qt::Gui Qt::GuiPrivate Qt::Concurrent Qt::Svg Qt::Qml Qt::Quick Qt::Widgets)
99-
if (${Qt6DBus_FOUND} AND NOT WIN32 AND NOT APPLE)
99+
if (${Qt6DBus_FOUND} AND NOT WIN32)
100100
target_link_libraries(chiaki Qt::DBus)
101101
target_compile_definitions(chiaki PRIVATE CHIAKI_HAVE_DBUS)
102102
endif()

gui/src/systemdinhibit.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "systemdinhibit.h"
22

3-
#ifdef CHIAKI_HAVE_DBUS
3+
#if defined(CHIAKI_HAVE_DBUS) && !defined(Q_OS_MACOS)
44
#include <fcntl.h>
55
#include <unistd.h>
66
#include <QDBusMessage>
@@ -17,7 +17,7 @@ SystemdInhibit::SystemdInhibit(const QString &who, const QString &why, const QSt
1717
, what(what)
1818
, mode(mode)
1919
{
20-
#ifdef CHIAKI_HAVE_DBUS
20+
#if defined(CHIAKI_HAVE_DBUS) && !defined(Q_OS_MACOS)
2121
QDBusConnection::systemBus().connect(QStringLiteral("org.freedesktop.login1"),
2222
QStringLiteral("/org/freedesktop/login1"),
2323
QStringLiteral("org.freedesktop.login1.Manager"),
@@ -29,7 +29,7 @@ SystemdInhibit::SystemdInhibit(const QString &who, const QString &why, const QSt
2929

3030
void SystemdInhibit::inhibit()
3131
{
32-
#ifdef CHIAKI_HAVE_DBUS
32+
#if defined(CHIAKI_HAVE_DBUS) && !defined(Q_OS_MACOS)
3333
QDBusMessage call = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.login1"),
3434
QStringLiteral("/org/freedesktop/login1"),
3535
QStringLiteral("org.freedesktop.login1.Manager"),
@@ -55,7 +55,7 @@ void SystemdInhibit::inhibit()
5555

5656
void SystemdInhibit::simulateUserActivity()
5757
{
58-
#ifdef CHIAKI_HAVE_DBUS
58+
#if defined(CHIAKI_HAVE_DBUS) && !defined(Q_OS_MACOS)
5959
QDBusMessage call = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.ScreenSaver"),
6060
QStringLiteral("/ScreenSaver"),
6161
QStringLiteral("org.freedesktop.ScreenSaver"),
@@ -82,7 +82,7 @@ void SystemdInhibit::login1PrepareForSleep(bool start)
8282

8383
void SystemdInhibit::release()
8484
{
85-
#ifdef CHIAKI_HAVE_DBUS
85+
#if defined(CHIAKI_HAVE_DBUS) && !defined(Q_OS_MACOS)
8686
if (fd >= 0)
8787
close(fd);
8888
fd = -1;

0 commit comments

Comments
 (0)