fix(wm): check for monitor changes on system resume

This commit is contained in:
alex-ds13
2025-02-13 11:28:42 +00:00
committed by LGUG2Z
parent b7ebd3fe63
commit 9c8a639282
+10 -11
View File
@@ -136,12 +136,13 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
let receiver = event_rx();
'receiver: for notification in receiver {
if !ACTIVE.load_consume() {
if matches!(
if !ACTIVE.load_consume()
&& matches!(
notification,
MonitorNotification::ResumingFromSuspendedState
| MonitorNotification::SessionUnlocked
) {
)
{
tracing::debug!(
"reactivating reconciliator - system has resumed from suspended state or session has been unlocked"
);
@@ -150,9 +151,6 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
border_manager::send_notification(None);
}
continue 'receiver;
}
let mut wm = wm.lock();
let initial_state = State::from(wm.as_ref());
@@ -164,10 +162,6 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
);
ACTIVE.store(false, Ordering::SeqCst);
}
MonitorNotification::ResumingFromSuspendedState
| MonitorNotification::SessionUnlocked => {
// this is only handled above if the reconciliator is paused
}
MonitorNotification::WorkAreaChanged => {
tracing::debug!("handling work area changed notification");
let offset = wm.work_area_offset;
@@ -247,7 +241,12 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
}
}
}
MonitorNotification::DisplayConnectionChange => {
// this is handled above if the reconciliator is paused but we should still check if
// there were any changes to the connected monitors while the system was
// suspended/locked.
MonitorNotification::ResumingFromSuspendedState
| MonitorNotification::SessionUnlocked
| MonitorNotification::DisplayConnectionChange => {
tracing::debug!("handling display connection change notification");
let mut monitor_cache = MONITOR_CACHE
.get_or_init(|| Mutex::new(HashMap::new()))