Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 215ab0a984 |
Generated
+1
-1
@@ -575,7 +575,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "moonlock"
|
||||
version = "0.6.15"
|
||||
version = "0.6.16"
|
||||
dependencies = [
|
||||
"gdk-pixbuf",
|
||||
"gdk4",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "moonlock"
|
||||
version = "0.6.15"
|
||||
version = "0.6.16"
|
||||
edition = "2024"
|
||||
description = "A secure Wayland lockscreen with GTK4, PAM and fingerprint support"
|
||||
license = "MIT"
|
||||
|
||||
+4
-21
@@ -72,39 +72,18 @@ fn activate_with_session_lock(
|
||||
.and_then(|path| lockscreen::load_background_texture(&path)),
|
||||
);
|
||||
|
||||
// Shared handles list — populated by connect_monitor, read by fingerprint init.
|
||||
// Declared before unlock_callback so the callback can inspect window state on unlock.
|
||||
let all_handles: Rc<RefCell<Vec<lockscreen::LockscreenHandles>>> =
|
||||
Rc::new(RefCell::new(Vec::new()));
|
||||
|
||||
// Shared unlock callback — unlocks session and quits.
|
||||
// Guard prevents double-unlock if PAM and fingerprint succeed simultaneously.
|
||||
let lock_clone = lock.clone();
|
||||
let app_clone = app.clone();
|
||||
let already_unlocked = Rc::new(Cell::new(false));
|
||||
let au = already_unlocked.clone();
|
||||
let all_handles_dbg = all_handles.clone();
|
||||
let unlock_callback: Rc<dyn Fn()> = Rc::new(move || {
|
||||
if au.get() {
|
||||
log::debug!("Unlock already triggered, ignoring duplicate");
|
||||
return;
|
||||
}
|
||||
au.set(true);
|
||||
// DIAGNOSTIC: log lock-window state at unlock to confirm whether a stale
|
||||
// window (unrealized / dead surface) remains in all_handles after a monitor
|
||||
// power-off/resume. Remove once the resume-unlock crash is fixed.
|
||||
{
|
||||
let handles = all_handles_dbg.borrow();
|
||||
log::info!("UNLOCK: {} window(s) in all_handles", handles.len());
|
||||
for (i, h) in handles.iter().enumerate() {
|
||||
log::info!(
|
||||
"UNLOCK: window[{i}] realized={} mapped={} visible={}",
|
||||
h.window.is_realized(),
|
||||
h.window.is_mapped(),
|
||||
h.window.is_visible(),
|
||||
);
|
||||
}
|
||||
}
|
||||
lock_clone.unlock();
|
||||
app_clone.quit();
|
||||
});
|
||||
@@ -116,6 +95,10 @@ fn activate_with_session_lock(
|
||||
// Shared config for use in the monitor signal handler
|
||||
let config = Rc::new(config.clone());
|
||||
|
||||
// Shared handles list — populated by connect_monitor, read by fingerprint init
|
||||
let all_handles: Rc<RefCell<Vec<lockscreen::LockscreenHandles>>> =
|
||||
Rc::new(RefCell::new(Vec::new()));
|
||||
|
||||
// Shared fingerprint listener — None until async init completes.
|
||||
// The monitor handler checks this to wire up FP labels on hotplugged monitors.
|
||||
let shared_fp: Rc<RefCell<Option<Rc<RefCell<FingerprintListener>>>>> =
|
||||
|
||||
Reference in New Issue
Block a user