mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-24 10:21:21 +01:00
fix(wm): ensure window restore on stackbar click
This commit ensures that a window is restored before a focus call is made on it when switching windows in a stack by using a window's tab in the stackbar. This handles the issue where two clicks are required to trigger a layout update the first time a window that is not currently at the top of the stack is brought to the front via a stackbar click.
This commit is contained in:
@@ -55,8 +55,6 @@ use komorebi_core::Rect;
|
||||
|
||||
use crate::window::Window;
|
||||
use crate::windows_api::WindowsApi;
|
||||
use crate::winevent_listener::event_tx;
|
||||
use crate::WindowManagerEvent;
|
||||
use crate::DEFAULT_CONTAINER_PADDING;
|
||||
use crate::STACKBAR_FOCUSED_TEXT_COLOUR;
|
||||
use crate::STACKBAR_TAB_BACKGROUND_COLOUR;
|
||||
@@ -115,6 +113,7 @@ impl Stackbar {
|
||||
|
||||
if x >= left && x <= right && y >= top && y <= bottom {
|
||||
let window = Window { hwnd: *win_hwnd };
|
||||
window.restore();
|
||||
if let Err(err) = window.focus(false) {
|
||||
tracing::error!("Stackbar focus error: HWND:{} {}", *win_hwnd, err);
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ impl Window {
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
let is_cloaked = self.is_cloaked()?;
|
||||
let is_cloaked = self.is_cloaked().unwrap_or_default();
|
||||
|
||||
let mut allow_cloaked = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user