diff --git a/docs/komorebi.example.json b/docs/komorebi.example.json index ff66e10f..f3bc73f7 100644 --- a/docs/komorebi.example.json +++ b/docs/komorebi.example.json @@ -1,15 +1,17 @@ { - "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.20/schema.json", + "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.22/schema.json", "app_specific_configuration_path": "$Env:USERPROFILE/applications.yaml", "window_hiding_behaviour": "Cloak", "cross_monitor_move_behaviour": "Insert", "default_workspace_padding": 20, "default_container_padding": 20, + "border_padding": 8, + "border_offset": -1, "active_window_border": false, "active_window_border_colours": { - "single": { "r": 66, "g": 165, "b": 245 }, - "stack": { "r": 256, "g": 165, "b": 66 }, - "monocle": { "r": 255, "g": 51, "b": 153 } + "single": "#42a5f5", + "stack": "#00a542", + "monocle": "#ff3399" }, "monitors": [ { diff --git a/komorebi.example.json b/komorebi.example.json index ff66e10f..f3bc73f7 100644 --- a/komorebi.example.json +++ b/komorebi.example.json @@ -1,15 +1,17 @@ { - "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.20/schema.json", + "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.22/schema.json", "app_specific_configuration_path": "$Env:USERPROFILE/applications.yaml", "window_hiding_behaviour": "Cloak", "cross_monitor_move_behaviour": "Insert", "default_workspace_padding": 20, "default_container_padding": 20, + "border_padding": 8, + "border_offset": -1, "active_window_border": false, "active_window_border_colours": { - "single": { "r": 66, "g": 165, "b": 245 }, - "stack": { "r": 256, "g": 165, "b": 66 }, - "monocle": { "r": 255, "g": 51, "b": 153 } + "single": "#42a5f5", + "stack": "#00a542", + "monocle": "#ff3399" }, "monitors": [ { diff --git a/komorebi/src/lib.rs b/komorebi/src/lib.rs index 413c93ba..1514fc80 100644 --- a/komorebi/src/lib.rs +++ b/komorebi/src/lib.rs @@ -192,7 +192,6 @@ lazy_static! { static ref BORDER_RECT: Arc> = Arc::new(Mutex::new(Rect::default())); - static ref BORDER_OFFSET: AtomicI32 = Default::default(); // Use app-specific titlebar removal options where possible // eg. Windows Terminal, IntelliJ IDEA, Firefox @@ -212,7 +211,9 @@ pub static BORDER_COLOUR_SINGLE: AtomicU32 = AtomicU32::new(0); pub static BORDER_COLOUR_STACK: AtomicU32 = AtomicU32::new(0); pub static BORDER_COLOUR_MONOCLE: AtomicU32 = AtomicU32::new(0); pub static BORDER_COLOUR_CURRENT: AtomicU32 = AtomicU32::new(0); -pub static BORDER_WIDTH: AtomicI32 = AtomicI32::new(20); +pub static BORDER_WIDTH: AtomicI32 = AtomicI32::new(8); +pub static BORDER_OFFSET: AtomicI32 = AtomicI32::new(-1); + // 0 0 0 aka pure black, I doubt anyone will want this as a border colour pub const TRANSPARENCY_COLOUR: u32 = 0; pub static REMOVE_TITLEBARS: AtomicBool = AtomicBool::new(false); diff --git a/komorebi/src/process_event.rs b/komorebi/src/process_event.rs index a5cb6f96..8be0d173 100644 --- a/komorebi/src/process_event.rs +++ b/komorebi/src/process_event.rs @@ -28,6 +28,8 @@ use crate::BORDER_COLOUR_STACK; use crate::BORDER_ENABLED; use crate::BORDER_HIDDEN; use crate::BORDER_HWND; +use crate::BORDER_OFFSET; +use crate::BORDER_WIDTH; use crate::DATA_DIR; use crate::HIDDEN_HWNDS; use crate::REGEX_IDENTIFIERS; @@ -378,7 +380,14 @@ impl WindowManager { // If we have moved across the monitors, use that override, otherwise determine // if a move has taken place by ruling out a resize - let is_move = moved_across_monitors || resize.right == 0 && resize.bottom == 0; + let right_bottom_constant = ((BORDER_WIDTH.load(Ordering::SeqCst) + + BORDER_OFFSET.load(Ordering::SeqCst)) + * 2) + .abs(); + + let is_move = moved_across_monitors + || resize.right.abs() == right_bottom_constant + && resize.bottom.abs() == right_bottom_constant; if is_move { tracing::info!("moving with mouse");