forked from quickshell/quickshell
		
	fix(slock): make SessionLock.secure accurate
This commit is contained in:
		
							parent
							
								
									cbdfba1a3f
								
							
						
					
					
						commit
						0b529c6682
					
				
					 5 changed files with 11 additions and 2 deletions
				
			
		| 
						 | 
					@ -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) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue