mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-10 15:12:52 +02:00
fix(wm): cycle stack focus w/ mff disabled
This commit ensures that the focus changes to the appropriate window when a container stack is being cycled through by a user who has disabled the mouse_follows_focus feature. fix #680
This commit is contained in:
@@ -866,6 +866,20 @@ impl WindowManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if we passed false for follow_focus
|
||||||
|
if !follow_focus
|
||||||
|
// and we have a stack with >1 windows
|
||||||
|
&& self.focused_container_mut()?.windows().len() > 1
|
||||||
|
// and we don't have a maxed window
|
||||||
|
&& self.focused_workspace()?.maximized_window().is_none()
|
||||||
|
// and we don't have a monocle container
|
||||||
|
&& self.focused_workspace()?.monocle_container().is_none()
|
||||||
|
{
|
||||||
|
if let Ok(window) = self.focused_window_mut() {
|
||||||
|
window.focus(self.mouse_follows_focus)?;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -239,9 +239,9 @@ pub extern "system" fn hidden_window(
|
|||||||
match message {
|
match message {
|
||||||
WM_DISPLAYCHANGE => {
|
WM_DISPLAYCHANGE => {
|
||||||
let event_type = WindowManagerEvent::DisplayChange(Window { hwnd: window.0 });
|
let event_type = WindowManagerEvent::DisplayChange(Window { hwnd: window.0 });
|
||||||
winevent_listener::event_tx()
|
winevent_listener::event_tx()
|
||||||
.send(event_type)
|
.send(event_type)
|
||||||
.expect("could not send message on winevent_listener::event_tx");
|
.expect("could not send message on winevent_listener::event_tx");
|
||||||
|
|
||||||
LRESULT(0)
|
LRESULT(0)
|
||||||
}
|
}
|
||||||
@@ -252,9 +252,9 @@ pub extern "system" fn hidden_window(
|
|||||||
|| wparam.0 as u32 == SPI_ICONVERTICALSPACING.0
|
|| wparam.0 as u32 == SPI_ICONVERTICALSPACING.0
|
||||||
{
|
{
|
||||||
let event_type = WindowManagerEvent::DisplayChange(Window { hwnd: window.0 });
|
let event_type = WindowManagerEvent::DisplayChange(Window { hwnd: window.0 });
|
||||||
winevent_listener::event_tx()
|
winevent_listener::event_tx()
|
||||||
.send(event_type)
|
.send(event_type)
|
||||||
.expect("could not send message on winevent_listener::event_tx");
|
.expect("could not send message on winevent_listener::event_tx");
|
||||||
}
|
}
|
||||||
LRESULT(0)
|
LRESULT(0)
|
||||||
}
|
}
|
||||||
@@ -263,9 +263,9 @@ pub extern "system" fn hidden_window(
|
|||||||
#[allow(clippy::cast_possible_truncation)]
|
#[allow(clippy::cast_possible_truncation)]
|
||||||
if wparam.0 as u32 == DBT_DEVNODES_CHANGED {
|
if wparam.0 as u32 == DBT_DEVNODES_CHANGED {
|
||||||
let event_type = WindowManagerEvent::DisplayChange(Window { hwnd: window.0 });
|
let event_type = WindowManagerEvent::DisplayChange(Window { hwnd: window.0 });
|
||||||
winevent_listener::event_tx()
|
winevent_listener::event_tx()
|
||||||
.send(event_type)
|
.send(event_type)
|
||||||
.expect("could not send message on winevent_listener::event_tx");
|
.expect("could not send message on winevent_listener::event_tx");
|
||||||
}
|
}
|
||||||
LRESULT(0)
|
LRESULT(0)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user