Skip to content

Commit

Permalink
fix: switch tty can not lock screen
Browse files Browse the repository at this point in the history
bind session manager LockChanged signal, if session is lock, to show
lock screen

Log:
  • Loading branch information
dengbo11 committed Jan 24, 2024
1 parent e310fb8 commit 4401aa3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/dde-lock/lockworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ void LockWorker::initConnections()
emit m_model->authFinished(true);
});

connect(m_sessionManagerInter, &SessionManagerInter::LockedChanged, this, [ this ](bool locked) {
qDebug() << "SessionManagerInter::LockedChanged" << locked;
if (locked && !m_model->visible()) {
m_model->showLockScreen();
}
});

/* org.freedesktop.login1.Session */
connect(m_login1SessionSelf, &Login1SessionSelf::ActiveChanged, this, [ = ](bool active) {
qInfo() << "DBusLockService::ActiveChanged:" << active;
Expand Down

0 comments on commit 4401aa3

Please sign in to comment.