mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-02-11 15:57:40 +01:00
Compare commits
4 Commits
feature/ta
...
feature/fl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1897e1845f | ||
|
|
192af6751b | ||
|
|
4f306e5bfd | ||
|
|
ede0b23bb4 |
@@ -305,7 +305,6 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
|
||||
|
||||
// Handle the monocle container separately
|
||||
if let Some(monocle) = ws.monocle_container() {
|
||||
let mut new_border = false;
|
||||
let border = match borders.entry(monocle.id().clone()) {
|
||||
Entry::Occupied(entry) => entry.into_mut(),
|
||||
Entry::Vacant(entry) => {
|
||||
@@ -313,7 +312,6 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
|
||||
monocle.id(),
|
||||
monocle.focused_window().copied().unwrap_or_default().hwnd,
|
||||
) {
|
||||
new_border = true;
|
||||
entry.insert(border)
|
||||
} else {
|
||||
continue 'monitors;
|
||||
@@ -344,9 +342,7 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
|
||||
|
||||
let rect = WindowsApi::window_rect(reference_hwnd)?;
|
||||
|
||||
if new_border {
|
||||
border.set_position(&rect, reference_hwnd)?;
|
||||
}
|
||||
border.set_position(&rect, reference_hwnd)?;
|
||||
|
||||
border.invalidate();
|
||||
|
||||
@@ -369,9 +365,11 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
|
||||
continue 'monitors;
|
||||
}
|
||||
|
||||
let is_maximized = WindowsApi::is_zoomed(
|
||||
WindowsApi::foreground_window().unwrap_or_default(),
|
||||
);
|
||||
let foreground_hwnd = WindowsApi::foreground_window().unwrap_or_default();
|
||||
let foreground_monitor_id =
|
||||
WindowsApi::monitor_from_window(foreground_hwnd);
|
||||
let is_maximized = foreground_monitor_id == m.id()
|
||||
&& WindowsApi::is_zoomed(foreground_hwnd);
|
||||
|
||||
if is_maximized {
|
||||
let mut to_remove = vec![];
|
||||
@@ -418,7 +416,6 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
|
||||
|
||||
for (idx, c) in ws.containers().iter().enumerate() {
|
||||
// Get the border entry for this container from the map or create one
|
||||
let mut new_border = false;
|
||||
let border = match borders.entry(c.id().clone()) {
|
||||
Entry::Occupied(entry) => entry.into_mut(),
|
||||
Entry::Vacant(entry) => {
|
||||
@@ -426,7 +423,6 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
|
||||
c.id(),
|
||||
c.focused_window().copied().unwrap_or_default().hwnd,
|
||||
) {
|
||||
new_border = true;
|
||||
entry.insert(border)
|
||||
} else {
|
||||
continue 'monitors;
|
||||
@@ -469,9 +465,7 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
|
||||
Some(last_focus_state) => last_focus_state != new_focus_state,
|
||||
};
|
||||
|
||||
if new_border {
|
||||
border.set_position(&rect, reference_hwnd)?;
|
||||
}
|
||||
border.set_position(&rect, reference_hwnd)?;
|
||||
|
||||
if should_invalidate {
|
||||
border.invalidate();
|
||||
@@ -479,15 +473,13 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
|
||||
}
|
||||
|
||||
{
|
||||
'windows: for window in ws.floating_windows() {
|
||||
let mut new_border = false;
|
||||
for window in ws.floating_windows() {
|
||||
let border = match borders.entry(window.hwnd.to_string()) {
|
||||
Entry::Occupied(entry) => entry.into_mut(),
|
||||
Entry::Vacant(entry) => {
|
||||
if let Ok(border) =
|
||||
Border::create(&window.hwnd.to_string(), window.hwnd)
|
||||
{
|
||||
new_border = true;
|
||||
entry.insert(border)
|
||||
} else {
|
||||
continue 'monitors;
|
||||
@@ -498,30 +490,23 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
|
||||
borders_monitors.insert(window.hwnd.to_string(), monitor_idx);
|
||||
windows_borders.insert(window.hwnd, border.clone());
|
||||
|
||||
let mut should_destroy = false;
|
||||
|
||||
if let Some(notification_hwnd) = notification.0 {
|
||||
if notification_hwnd != window.hwnd {
|
||||
should_destroy = true;
|
||||
}
|
||||
}
|
||||
let mut is_focused = false;
|
||||
|
||||
if WindowsApi::foreground_window().unwrap_or_default()
|
||||
!= window.hwnd
|
||||
== window.hwnd
|
||||
{
|
||||
should_destroy = true;
|
||||
}
|
||||
|
||||
if should_destroy {
|
||||
border.destroy()?;
|
||||
borders.remove(&window.hwnd.to_string());
|
||||
borders_monitors.remove(&window.hwnd.to_string());
|
||||
continue 'windows;
|
||||
is_focused = true;
|
||||
}
|
||||
|
||||
#[allow(unused_assignments)]
|
||||
let mut last_focus_state = None;
|
||||
let new_focus_state = WindowKind::Floating;
|
||||
let new_focus_state = if is_focused {
|
||||
WindowKind::Floating
|
||||
} else {
|
||||
WindowKind::Unfocused
|
||||
};
|
||||
|
||||
// Update the focused state for all containers on this workspace
|
||||
{
|
||||
let mut focus_state = FOCUS_STATE.lock();
|
||||
last_focus_state =
|
||||
@@ -535,9 +520,9 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
|
||||
Some(last_focus_state) => last_focus_state != new_focus_state,
|
||||
};
|
||||
|
||||
if new_border {
|
||||
border.set_position(&rect, window.hwnd)?;
|
||||
}
|
||||
// this has to be sent to match the z-order when clicking on
|
||||
// a floating window to focus it
|
||||
border.set_position(&rect, window.hwnd)?;
|
||||
|
||||
if should_invalidate {
|
||||
border.invalidate();
|
||||
|
||||
962
schema.bar.json
962
schema.bar.json
File diff suppressed because it is too large
Load Diff
140
schema.json
140
schema.json
@@ -13,13 +13,35 @@
|
||||
"properties": {
|
||||
"duration": {
|
||||
"description": "Set the animation duration in ms (default: 250)",
|
||||
"type": "integer",
|
||||
"format": "uint64",
|
||||
"minimum": 0.0
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "integer",
|
||||
"format": "uint64",
|
||||
"minimum": 0.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"format": "uint64",
|
||||
"minimum": 0.0
|
||||
}
|
||||
]
|
||||
},
|
||||
"enabled": {
|
||||
"description": "Enable or disable animations (default: false)",
|
||||
"type": "boolean"
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "boolean"
|
||||
}
|
||||
]
|
||||
},
|
||||
"fps": {
|
||||
"description": "Set the animation FPS (default: 60)",
|
||||
@@ -29,38 +51,80 @@
|
||||
},
|
||||
"style": {
|
||||
"description": "Set the animation style (default: Linear)",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Linear",
|
||||
"EaseInSine",
|
||||
"EaseOutSine",
|
||||
"EaseInOutSine",
|
||||
"EaseInQuad",
|
||||
"EaseOutQuad",
|
||||
"EaseInOutQuad",
|
||||
"EaseInCubic",
|
||||
"EaseInOutCubic",
|
||||
"EaseInQuart",
|
||||
"EaseOutQuart",
|
||||
"EaseInOutQuart",
|
||||
"EaseInQuint",
|
||||
"EaseOutQuint",
|
||||
"EaseInOutQuint",
|
||||
"EaseInExpo",
|
||||
"EaseOutExpo",
|
||||
"EaseInOutExpo",
|
||||
"EaseInCirc",
|
||||
"EaseOutCirc",
|
||||
"EaseInOutCirc",
|
||||
"EaseInBack",
|
||||
"EaseOutBack",
|
||||
"EaseInOutBack",
|
||||
"EaseInElastic",
|
||||
"EaseOutElastic",
|
||||
"EaseInOutElastic",
|
||||
"EaseInBounce",
|
||||
"EaseOutBounce",
|
||||
"EaseInOutBounce"
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Linear",
|
||||
"EaseInSine",
|
||||
"EaseOutSine",
|
||||
"EaseInOutSine",
|
||||
"EaseInQuad",
|
||||
"EaseOutQuad",
|
||||
"EaseInOutQuad",
|
||||
"EaseInCubic",
|
||||
"EaseInOutCubic",
|
||||
"EaseInQuart",
|
||||
"EaseOutQuart",
|
||||
"EaseInOutQuart",
|
||||
"EaseInQuint",
|
||||
"EaseOutQuint",
|
||||
"EaseInOutQuint",
|
||||
"EaseInExpo",
|
||||
"EaseOutExpo",
|
||||
"EaseInOutExpo",
|
||||
"EaseInCirc",
|
||||
"EaseOutCirc",
|
||||
"EaseInOutCirc",
|
||||
"EaseInBack",
|
||||
"EaseOutBack",
|
||||
"EaseInOutBack",
|
||||
"EaseInElastic",
|
||||
"EaseOutElastic",
|
||||
"EaseInOutElastic",
|
||||
"EaseInBounce",
|
||||
"EaseOutBounce",
|
||||
"EaseInOutBounce"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Linear",
|
||||
"EaseInSine",
|
||||
"EaseOutSine",
|
||||
"EaseInOutSine",
|
||||
"EaseInQuad",
|
||||
"EaseOutQuad",
|
||||
"EaseInOutQuad",
|
||||
"EaseInCubic",
|
||||
"EaseInOutCubic",
|
||||
"EaseInQuart",
|
||||
"EaseOutQuart",
|
||||
"EaseInOutQuart",
|
||||
"EaseInQuint",
|
||||
"EaseOutQuint",
|
||||
"EaseInOutQuint",
|
||||
"EaseInExpo",
|
||||
"EaseOutExpo",
|
||||
"EaseInOutExpo",
|
||||
"EaseInCirc",
|
||||
"EaseOutCirc",
|
||||
"EaseInOutCirc",
|
||||
"EaseInBack",
|
||||
"EaseOutBack",
|
||||
"EaseInOutBack",
|
||||
"EaseInElastic",
|
||||
"EaseOutElastic",
|
||||
"EaseInOutElastic",
|
||||
"EaseInBounce",
|
||||
"EaseOutBounce",
|
||||
"EaseInOutBounce"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -420,7 +484,7 @@
|
||||
"format": "int32"
|
||||
},
|
||||
"border_z_order": {
|
||||
"description": "Active window border z-order (default: System)",
|
||||
"description": "DEPRECATED from v0.1.31: no longer required",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Top",
|
||||
@@ -579,7 +643,7 @@
|
||||
}
|
||||
},
|
||||
"focus_follows_mouse": {
|
||||
"description": "END OF LIFE FEATURE: Determine focus follows mouse implementation (default: None)",
|
||||
"description": "END OF LIFE FEATURE: Use https://github.com/LGUG2Z/masir instead",
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "A custom FFM implementation (slightly more CPU-intensive)",
|
||||
|
||||
Reference in New Issue
Block a user