diff --git a/komorebi/src/process_command.rs b/komorebi/src/process_command.rs index 39ddfa2f..4b72bb4f 100644 --- a/komorebi/src/process_command.rs +++ b/komorebi/src/process_command.rs @@ -72,6 +72,7 @@ use crate::SUBSCRIPTION_PIPES; use crate::SUBSCRIPTION_SOCKETS; use crate::TCP_CONNECTIONS; use crate::TRAY_AND_MULTI_WINDOW_IDENTIFIERS; +use crate::WINDOWS_11; use crate::WORKSPACE_RULES; use stackbar_manager::STACKBAR_FOCUSED_TEXT_COLOUR; use stackbar_manager::STACKBAR_LABEL; @@ -1244,17 +1245,23 @@ impl WindowManager { border_manager::BORDER_ENABLED.store(enable, Ordering::SeqCst); } SocketMessage::BorderImplementation(implementation) => { - IMPLEMENTATION.store(implementation); - match IMPLEMENTATION.load() { - BorderImplementation::Komorebi => { - self.remove_all_accents()?; + if !*WINDOWS_11 && matches!(implementation, BorderImplementation::Windows) { + tracing::error!( + "BorderImplementation::Windows is only supported on Windows 11 and above" + ); + } else { + IMPLEMENTATION.store(implementation); + match IMPLEMENTATION.load() { + BorderImplementation::Komorebi => { + self.remove_all_accents()?; + } + BorderImplementation::Windows => { + border_manager::destroy_all_borders()?; + } } - BorderImplementation::Windows => { - border_manager::destroy_all_borders()?; - } - } - border_manager::send_notification(); + border_manager::send_notification(); + } } SocketMessage::BorderColour(kind, r, g, b) => match kind { WindowKind::Single => { diff --git a/komorebi/src/static_config.rs b/komorebi/src/static_config.rs index d95a04d7..6b51f43f 100644 --- a/komorebi/src/static_config.rs +++ b/komorebi/src/static_config.rs @@ -33,6 +33,7 @@ use crate::MONITOR_INDEX_PREFERENCES; use crate::OBJECT_NAME_CHANGE_ON_LAUNCH; use crate::REGEX_IDENTIFIERS; use crate::TRAY_AND_MULTI_WINDOW_IDENTIFIERS; +use crate::WINDOWS_11; use crate::WORKSPACE_RULES; use komorebi_core::BorderImplementation; use komorebi_core::StackbarLabel; @@ -596,17 +597,29 @@ impl StaticConfig { } STYLE.store(self.border_style.unwrap_or_default()); - IMPLEMENTATION.store(self.border_implementation.unwrap_or_default()); - match IMPLEMENTATION.load() { - BorderImplementation::Komorebi => { - border_manager::destroy_all_borders()?; - } - BorderImplementation::Windows => { - // TODO: figure out how to call wm.remove_all_accents here - } - } - border_manager::send_notification(); + if !*WINDOWS_11 + && matches!( + self.border_implementation.unwrap_or_default(), + BorderImplementation::Windows + ) + { + tracing::error!( + "BorderImplementation::Windows is only supported on Windows 11 and above" + ); + } else { + IMPLEMENTATION.store(self.border_implementation.unwrap_or_default()); + match IMPLEMENTATION.load() { + BorderImplementation::Komorebi => { + border_manager::destroy_all_borders()?; + } + BorderImplementation::Windows => { + // TODO: figure out how to call wm.remove_all_accents here + } + } + + border_manager::send_notification(); + } transparency_manager::TRANSPARENCY_ENABLED .store(self.transparency.unwrap_or(false), Ordering::SeqCst);