mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-24 01:28:39 +02:00
fix(borders): ignore borders on all stack window updates
This commit is contained in:
@@ -52,19 +52,12 @@ impl Container {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Hides the unfocused windows of the container and restores the focused one. This function
|
||||||
|
/// is used to make sure we update the window that should be shown on a stack. If the container
|
||||||
|
/// isn't a stack this function won't change anything.
|
||||||
pub fn load_focused_window(&mut self) {
|
pub fn load_focused_window(&mut self) {
|
||||||
let focused_idx = self.focused_window_idx();
|
let focused_idx = self.focused_window_idx();
|
||||||
for (i, window) in self.windows_mut().iter_mut().enumerate() {
|
|
||||||
if i == focused_idx {
|
|
||||||
window.restore();
|
|
||||||
} else {
|
|
||||||
window.hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn load_focused_window_ignore_borders(&mut self) {
|
|
||||||
let focused_idx = self.focused_window_idx();
|
|
||||||
for (i, window) in self.windows_mut().iter_mut().enumerate() {
|
for (i, window) in self.windows_mut().iter_mut().enumerate() {
|
||||||
if i == focused_idx {
|
if i == focused_idx {
|
||||||
window.restore_with_border(false);
|
window.restore_with_border(false);
|
||||||
@@ -109,14 +102,13 @@ impl Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn idx_for_window(&self, hwnd: isize) -> Option<usize> {
|
pub fn idx_for_window(&self, hwnd: isize) -> Option<usize> {
|
||||||
let mut idx = None;
|
|
||||||
for (i, window) in self.windows().iter().enumerate() {
|
for (i, window) in self.windows().iter().enumerate() {
|
||||||
if window.hwnd == hwnd {
|
if window.hwnd == hwnd {
|
||||||
idx = Option::from(i);
|
return Option::from(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
idx
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn remove_window_by_idx(&mut self, idx: usize) -> Option<Window> {
|
pub fn remove_window_by_idx(&mut self, idx: usize) -> Option<Window> {
|
||||||
|
|||||||
@@ -2530,7 +2530,7 @@ impl WindowManager {
|
|||||||
let next_idx = direction.next_idx(current_idx, len);
|
let next_idx = direction.next_idx(current_idx, len);
|
||||||
|
|
||||||
container.focus_window(next_idx);
|
container.focus_window(next_idx);
|
||||||
container.load_focused_window_ignore_borders();
|
container.load_focused_window();
|
||||||
|
|
||||||
self.update_focused_workspace(self.mouse_follows_focus, true)
|
self.update_focused_workspace(self.mouse_follows_focus, true)
|
||||||
}
|
}
|
||||||
@@ -2563,7 +2563,7 @@ impl WindowManager {
|
|||||||
container.windows_mut().swap(current_idx, next_idx);
|
container.windows_mut().swap(current_idx, next_idx);
|
||||||
|
|
||||||
container.focus_window(next_idx);
|
container.focus_window(next_idx);
|
||||||
container.load_focused_window_ignore_borders();
|
container.load_focused_window();
|
||||||
|
|
||||||
self.update_focused_workspace(self.mouse_follows_focus, true)
|
self.update_focused_workspace(self.mouse_follows_focus, true)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user