From 990a339d4e7426f19898a6c9d195e7a1b99f054e Mon Sep 17 00:00:00 2001 From: alex-ds13 <145657253+alex-ds13@users.noreply.github.com> Date: Sun, 23 Feb 2025 22:59:02 +0000 Subject: [PATCH] fix(bar): apply work area offset on monitor reconnect This commit makes sure the bar applies the the `work_area_offset` correctly after a monitor reconnects; if it is the first time a monitor is connecting, the cached offset won't exist yet. --- komorebi-bar/src/bar.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/komorebi-bar/src/bar.rs b/komorebi-bar/src/bar.rs index 092b0a42..c9dcf75f 100644 --- a/komorebi-bar/src/bar.rs +++ b/komorebi-bar/src/bar.rs @@ -718,6 +718,12 @@ impl eframe::App for Komobar { } } + // Reset the current `work_area_offset` so that it gets recalculated and + // properly applied again, since if the monitor has connected for the first + // time it won't have the work_area_offset applied but the bar thinks it + // does. + self.work_area_offset = komorebi_client::Rect::default(); + should_apply_config = true; } self.disabled = false;