From eadc214bc68eef9694b344cd1ddb6f13f07b065e Mon Sep 17 00:00:00 2001 From: Matt Campbell Date: Mon, 23 Dec 2024 15:02:46 -0600 Subject: [PATCH 1/3] windows: Fix the event loop to wake on accessibility requests Fixes #4055. --- src/changelog/unreleased.md | 1 + src/platform_impl/windows/event_loop.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/changelog/unreleased.md b/src/changelog/unreleased.md index a835e0c944..6cf5fc3772 100644 --- a/src/changelog/unreleased.md +++ b/src/changelog/unreleased.md @@ -200,3 +200,4 @@ changelog entry. - On macOS, fixed the scancode conversion for audio volume keys. - On macOS, fixed the scancode conversion for `IntlBackslash`. - On macOS, fixed redundant `SurfaceResized` event at window creation. +- On Windows, fixed the event loop to wake on accessibility requests. diff --git a/src/platform_impl/windows/event_loop.rs b/src/platform_impl/windows/event_loop.rs index 0b99ca6bfa..2f3e08e008 100644 --- a/src/platform_impl/windows/event_loop.rs +++ b/src/platform_impl/windows/event_loop.rs @@ -43,7 +43,7 @@ use windows_sys::Win32::UI::WindowsAndMessaging::{ GetMenu, LoadCursorW, MsgWaitForMultipleObjectsEx, PeekMessageW, PostMessageW, RegisterClassExW, RegisterWindowMessageA, SetCursor, SetWindowPos, TranslateMessage, CREATESTRUCTW, GWL_STYLE, GWL_USERDATA, HTCAPTION, HTCLIENT, MINMAXINFO, MNC_CLOSE, MSG, - MWMO_INPUTAVAILABLE, NCCALCSIZE_PARAMS, PM_REMOVE, PT_TOUCH, QS_ALLEVENTS, RI_MOUSE_HWHEEL, + MWMO_INPUTAVAILABLE, NCCALCSIZE_PARAMS, PM_REMOVE, PT_TOUCH, QS_ALLINPUT, RI_MOUSE_HWHEEL, RI_MOUSE_WHEEL, SC_MINIMIZE, SC_RESTORE, SIZE_MAXIMIZED, SWP_NOACTIVATE, SWP_NOMOVE, SWP_NOSIZE, SWP_NOZORDER, WHEEL_DELTA, WINDOWPOS, WMSZ_BOTTOM, WMSZ_BOTTOMLEFT, WMSZ_BOTTOMRIGHT, WMSZ_LEFT, WMSZ_RIGHT, WMSZ_TOP, WMSZ_TOPLEFT, WMSZ_TOPRIGHT, @@ -740,7 +740,7 @@ fn wait_for_messages_impl( num_handles, raw_handles.as_ptr() as *const _, wait_duration_ms, - QS_ALLEVENTS, + QS_ALLINPUT, MWMO_INPUTAVAILABLE, ); if result == WAIT_FAILED { From 8994ee632822530bfaf6cdf651e995ade0626976 Mon Sep 17 00:00:00 2001 From: Matt Campbell Date: Mon, 23 Dec 2024 15:08:20 -0600 Subject: [PATCH 2/3] Add a comment --- src/platform_impl/windows/event_loop.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform_impl/windows/event_loop.rs b/src/platform_impl/windows/event_loop.rs index 2f3e08e008..d453814c5f 100644 --- a/src/platform_impl/windows/event_loop.rs +++ b/src/platform_impl/windows/event_loop.rs @@ -736,6 +736,7 @@ fn wait_for_messages_impl( let (num_handles, raw_handles) = if use_timer { (1, [high_resolution_timer.unwrap()]) } else { (0, [ptr::null_mut()]) }; + // We must use `QS_ALLINPUT` to wake on accessibility messages. let result = MsgWaitForMultipleObjectsEx( num_handles, raw_handles.as_ptr() as *const _, From 717b147fbf69e4c2a02559ad2a743a6c9135a63d Mon Sep 17 00:00:00 2001 From: Matt Campbell Date: Mon, 23 Dec 2024 15:15:22 -0600 Subject: [PATCH 3/3] Fix changelog entry Co-authored-by: Kirill Chibisov --- src/changelog/unreleased.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/changelog/unreleased.md b/src/changelog/unreleased.md index 6cf5fc3772..e9c550ffe3 100644 --- a/src/changelog/unreleased.md +++ b/src/changelog/unreleased.md @@ -200,4 +200,4 @@ changelog entry. - On macOS, fixed the scancode conversion for audio volume keys. - On macOS, fixed the scancode conversion for `IntlBackslash`. - On macOS, fixed redundant `SurfaceResized` event at window creation. -- On Windows, fixed the event loop to wake on accessibility requests. +- On Windows, fixed the event loop not waking on accessibility requests.