From be5945c64b614784cb3b5d16887c00388884c36d Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 13 Aug 2022 16:36:21 -0700 Subject: [PATCH] fix(wm): create active border only on command --- komorebi/src/main.rs | 3 --- komorebi/src/process_command.rs | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/komorebi/src/main.rs b/komorebi/src/main.rs index ec710159..2b1423e0 100644 --- a/komorebi/src/main.rs +++ b/komorebi/src/main.rs @@ -41,7 +41,6 @@ use komorebi_core::HidingBehaviour; use komorebi_core::Rect; use komorebi_core::SocketMessage; -use crate::border::Border; use crate::process_command::listen_for_commands; use crate::process_event::listen_for_events; use crate::process_movement::listen_for_movements; @@ -469,8 +468,6 @@ fn main() -> Result<()> { } } - Border::create("komorebi-border-window")?; - let (outgoing, incoming): (Sender, Receiver) = crossbeam_channel::unbounded(); diff --git a/komorebi/src/process_command.rs b/komorebi/src/process_command.rs index 08bd06ef..ab7fdc35 100644 --- a/komorebi/src/process_command.rs +++ b/komorebi/src/process_command.rs @@ -755,6 +755,10 @@ impl WindowManager { } SocketMessage::ActiveWindowBorder(enable) => { if enable { + if BORDER_HWND.load(Ordering::SeqCst) == 0 { + Border::create("komorebi-border-window")?; + } + BORDER_ENABLED.store(true, Ordering::SeqCst); self.show_border()?; } else {