fix(bar): check monitor connection on all notifications

This commit is contained in:
alex-ds13
2025-02-08 03:40:16 +00:00
committed by LGUG2Z
parent ec8519d75a
commit b7ebd3fe63

View File

@@ -673,10 +673,6 @@ impl eframe::App for Komobar {
}
},
Ok(KomorebiEvent::Notification(notification)) => {
let should_apply_config = if matches!(
notification.event,
NotificationEvent::Monitor(MonitorNotification::DisplayConnectionChange)
) {
let state = &notification.state;
let usr_monitor_index = match &self.config.monitor {
MonitorConfigOrIndex::MonitorConfig(monitor_config) => monitor_config.index,
@@ -717,6 +713,10 @@ impl eframe::App for Komobar {
self.disabled = false;
}
let should_apply_config = if matches!(
notification.event,
NotificationEvent::Monitor(MonitorNotification::DisplayConnectionChange)
) {
// Store the monitor coordinates in case they've changed
MONITOR_RIGHT.store(
state.monitors.elements()[self.monitor_index].size().right,