mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-25 04:59:16 +02:00
fix(wm): check for monitor changes on system resume
This commit is contained in:
@@ -136,21 +136,19 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
|
|||||||
let receiver = event_rx();
|
let receiver = event_rx();
|
||||||
|
|
||||||
'receiver: for notification in receiver {
|
'receiver: for notification in receiver {
|
||||||
if !ACTIVE.load_consume() {
|
if !ACTIVE.load_consume()
|
||||||
if matches!(
|
&& matches!(
|
||||||
notification,
|
notification,
|
||||||
MonitorNotification::ResumingFromSuspendedState
|
MonitorNotification::ResumingFromSuspendedState
|
||||||
| MonitorNotification::SessionUnlocked
|
| MonitorNotification::SessionUnlocked
|
||||||
) {
|
)
|
||||||
tracing::debug!(
|
{
|
||||||
"reactivating reconciliator - system has resumed from suspended state or session has been unlocked"
|
tracing::debug!(
|
||||||
);
|
"reactivating reconciliator - system has resumed from suspended state or session has been unlocked"
|
||||||
|
);
|
||||||
|
|
||||||
ACTIVE.store(true, Ordering::SeqCst);
|
ACTIVE.store(true, Ordering::SeqCst);
|
||||||
border_manager::send_notification(None);
|
border_manager::send_notification(None);
|
||||||
}
|
|
||||||
|
|
||||||
continue 'receiver;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut wm = wm.lock();
|
let mut wm = wm.lock();
|
||||||
@@ -164,10 +162,6 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
|
|||||||
);
|
);
|
||||||
ACTIVE.store(false, Ordering::SeqCst);
|
ACTIVE.store(false, Ordering::SeqCst);
|
||||||
}
|
}
|
||||||
MonitorNotification::ResumingFromSuspendedState
|
|
||||||
| MonitorNotification::SessionUnlocked => {
|
|
||||||
// this is only handled above if the reconciliator is paused
|
|
||||||
}
|
|
||||||
MonitorNotification::WorkAreaChanged => {
|
MonitorNotification::WorkAreaChanged => {
|
||||||
tracing::debug!("handling work area changed notification");
|
tracing::debug!("handling work area changed notification");
|
||||||
let offset = wm.work_area_offset;
|
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");
|
tracing::debug!("handling display connection change notification");
|
||||||
let mut monitor_cache = MONITOR_CACHE
|
let mut monitor_cache = MONITOR_CACHE
|
||||||
.get_or_init(|| Mutex::new(HashMap::new()))
|
.get_or_init(|| Mutex::new(HashMap::new()))
|
||||||
|
|||||||
Reference in New Issue
Block a user