Use session D-Bus for ukui ScreenSaver connections
Replace QDBusConnection::systemBus() with QDBusConnection::sessionBus() when creating the org.ukui.ScreenSaver interface and connecting Lock/Unlock signals so notifications are tied to the user session
This commit is contained in:
parent
ac16f7d054
commit
eaa40929bd
|
|
@ -204,7 +204,7 @@ bool ScreenLockDetector::connectToUkuiManager()
|
||||||
"org.ukui.ScreenSaver",
|
"org.ukui.ScreenSaver",
|
||||||
sessionPath,
|
sessionPath,
|
||||||
"org.ukui.ScreenSaver",
|
"org.ukui.ScreenSaver",
|
||||||
QDBusConnection::systemBus(),
|
QDBusConnection::sessionBus(),
|
||||||
this
|
this
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -212,7 +212,7 @@ bool ScreenLockDetector::connectToUkuiManager()
|
||||||
qDebug() << "ukui ScreenSaver interface is valid for session:" << sessionPath;
|
qDebug() << "ukui ScreenSaver interface is valid for session:" << sessionPath;
|
||||||
|
|
||||||
// 连接Lock和Unlock信号到特定会话
|
// 连接Lock和Unlock信号到特定会话
|
||||||
bool lockConnected = QDBusConnection::systemBus().connect(
|
bool lockConnected = QDBusConnection::sessionBus().connect(
|
||||||
"org.ukui.ScreenSaver",
|
"org.ukui.ScreenSaver",
|
||||||
sessionPath,
|
sessionPath,
|
||||||
"org.ukui.ScreenSaver",
|
"org.ukui.ScreenSaver",
|
||||||
|
|
@ -221,7 +221,7 @@ bool ScreenLockDetector::connectToUkuiManager()
|
||||||
SLOT(onSessionLocked())
|
SLOT(onSessionLocked())
|
||||||
);
|
);
|
||||||
|
|
||||||
bool unlockConnected = QDBusConnection::systemBus().connect(
|
bool unlockConnected = QDBusConnection::sessionBus().connect(
|
||||||
"org.ukui.ScreenSaver",
|
"org.ukui.ScreenSaver",
|
||||||
sessionPath,
|
sessionPath,
|
||||||
"org.ukui.ScreenSaver",
|
"org.ukui.ScreenSaver",
|
||||||
|
|
@ -469,4 +469,4 @@ void ScreenLockDetector::onSessionUnlocked()
|
||||||
setLockState(false);
|
setLockState(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // Q_OS_LINUX
|
#endif // Q_OS_LINUX
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue