mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-06 19:03:40 +02:00
fix(wm): make force-focus command read wm state
This commit ensures that the force-focus command reads the window manager state to get the coordinates of the window that should be currently focused, places the cursor in the middle of that rect, and then simulates a left-click.
This commit is contained in:
@@ -181,6 +181,9 @@ impl WindowManager {
|
||||
self.cycle_container_window_in_direction(direction)?;
|
||||
}
|
||||
SocketMessage::ForceFocus => {
|
||||
let focused_window = self.focused_window()?;
|
||||
let focused_window_rect = WindowsApi::window_rect(focused_window.hwnd())?;
|
||||
WindowsApi::center_cursor_in_rect(&focused_window_rect)?;
|
||||
WindowsApi::left_click();
|
||||
}
|
||||
SocketMessage::Close => self.focused_window()?.close()?,
|
||||
|
||||
Reference in New Issue
Block a user