fix(slock): make SessionLock.secure accurate

This commit is contained in:
outfoxxed 2024-02-28 21:41:30 -08:00
parent cbdfba1a3f
commit 0b529c6682
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
5 changed files with 11 additions and 2 deletions

View file

@ -89,7 +89,10 @@ void SessionLock::updateSurfaces(SessionLock* old) {
instance->onReload(oldInstance); instance->onReload(oldInstance);
this->surfaces[screen] = instance; this->surfaces[screen] = instance;
instance->show(); }
for (auto* surface: this->surfaces.values()) {
surface->show();
} }
} }
} }
@ -117,7 +120,7 @@ bool SessionLock::isLocked() const {
} }
bool SessionLock::isSecure() const { bool SessionLock::isSecure() const {
return this->manager != nullptr && SessionLockManager::sessionLocked(); return this->manager != nullptr && SessionLockManager::isSecure();
} }
void SessionLock::setLocked(bool locked) { void SessionLock::setLocked(bool locked) {

View file

@ -18,3 +18,6 @@ QSWaylandSessionLock* QSWaylandSessionLockManager::acquireLock() {
} }
bool QSWaylandSessionLockManager::isLocked() const { return this->active != nullptr; } bool QSWaylandSessionLockManager::isLocked() const { return this->active != nullptr; }
bool QSWaylandSessionLockManager::isSecure() const {
return this->isLocked() && this->active->hasCompositorLock();
}

View file

@ -17,6 +17,7 @@ public:
// Create a new session lock if there is no currently active lock, otherwise null. // Create a new session lock if there is no currently active lock, otherwise null.
QSWaylandSessionLock* acquireLock(); QSWaylandSessionLock* acquireLock();
[[nodiscard]] bool isLocked() const; [[nodiscard]] bool isLocked() const;
[[nodiscard]] bool isSecure() const;
static bool sessionLocked(); static bool sessionLocked();

View file

@ -44,6 +44,7 @@ bool SessionLockManager::unlock() {
bool SessionLockManager::isLocked() const { return this->mLock != nullptr; } bool SessionLockManager::isLocked() const { return this->mLock != nullptr; }
bool SessionLockManager::sessionLocked() { return manager()->isLocked(); } bool SessionLockManager::sessionLocked() { return manager()->isLocked(); }
bool SessionLockManager::isSecure() { return manager()->isSecure(); }
LockWindowExtension::~LockWindowExtension() { LockWindowExtension::~LockWindowExtension() {
if (this->surface != nullptr) { if (this->surface != nullptr) {

View file

@ -26,6 +26,7 @@ public:
[[nodiscard]] bool isLocked() const; [[nodiscard]] bool isLocked() const;
static bool sessionLocked(); static bool sessionLocked();
static bool isSecure();
signals: signals:
// This signal is sent once the compositor considers the session to be fully locked. // This signal is sent once the compositor considers the session to be fully locked.