diff --git a/crates/gpui/src/platform/windows/events.rs b/crates/gpui/src/platform/windows/events.rs index 027c6c4dac..a390762ddd 100644 --- a/crates/gpui/src/platform/windows/events.rs +++ b/crates/gpui/src/platform/windows/events.rs @@ -92,7 +92,7 @@ pub(crate) fn handle_msg( WM_DEADCHAR => handle_dead_char_msg(wparam, state_ptr), WM_IME_STARTCOMPOSITION => handle_ime_position(handle, state_ptr), WM_IME_COMPOSITION => handle_ime_composition(handle, lparam, state_ptr), - WM_SETCURSOR => handle_set_cursor(lparam, state_ptr), + WM_SETCURSOR => handle_set_cursor(handle, lparam, state_ptr), WM_SETTINGCHANGE => handle_system_settings_changed(handle, lparam, state_ptr), WM_INPUTLANGCHANGE => handle_input_language_changed(lparam, state_ptr), WM_GPUI_CURSOR_STYLE_CHANGED => handle_cursor_changed(lparam, state_ptr), @@ -1108,11 +1108,24 @@ fn handle_cursor_changed(lparam: LPARAM, state_ptr: Rc) - Some(0) } -fn handle_set_cursor(lparam: LPARAM, state_ptr: Rc) -> Option { - if matches!( - lparam.loword() as u32, - HTLEFT | HTRIGHT | HTTOP | HTTOPLEFT | HTTOPRIGHT | HTBOTTOM | HTBOTTOMLEFT | HTBOTTOMRIGHT - ) { +fn handle_set_cursor( + handle: HWND, + lparam: LPARAM, + state_ptr: Rc, +) -> Option { + if unsafe { !IsWindowEnabled(handle).as_bool() } + || matches!( + lparam.loword() as u32, + HTLEFT + | HTRIGHT + | HTTOP + | HTTOPLEFT + | HTTOPRIGHT + | HTBOTTOM + | HTBOTTOMLEFT + | HTBOTTOMRIGHT + ) + { return None; } unsafe {