mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-13 12:23:38 +01: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:
1 parent
4ee4d199a0
commit
99af0f8f7b
1 file changed
+3
@@ -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