From 559fa55b9ffed81e42f525c11bf122799aecf159 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Tue, 19 Nov 2024 20:49:39 -0800 Subject: [PATCH] hardcoded cursor at top left --- komorebi/src/windows_api.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/komorebi/src/windows_api.rs b/komorebi/src/windows_api.rs index 6548c0d4..4239441b 100644 --- a/komorebi/src/windows_api.rs +++ b/komorebi/src/windows_api.rs @@ -675,7 +675,12 @@ impl WindowsApi { } pub fn center_cursor_in_rect(rect: &Rect) -> Result<()> { - Self::set_cursor_pos(rect.left + (rect.right / 2), rect.top + (rect.bottom / 2)) + Self::place_cursor_at_top_left_of_rect(rect) + // Self::set_cursor_pos(rect.left + (rect.right / 2), rect.top + (rect.bottom / 2)) + } + + pub fn place_cursor_at_top_left_of_rect(rect: &Rect) -> Result<()> { + Self::set_cursor_pos(rect.left + 15, rect.top + 15) } pub fn window_thread_process_id(hwnd: isize) -> (u32, u32) {