Skip to content

Commit

Permalink
windows: Fix MsgWaitForMultipleObjects call to wake on accessibility …
Browse files Browse the repository at this point in the history
…messages winit/#4057
  • Loading branch information
raphamorim committed Dec 25, 2024
1 parent 4d1fbde commit 5bc94a3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ language: 'en'
- Allow `Renderer` to be configured cross-platform by `Platform` property.
- Add `ToggleFullscreen` to configurable actions.
- Always emit `1` for the first parameter when having modifiers in kitty keyboard protocol.
- Microsoft Windows: fix the event loop not waking on accessibility requests.

## 0.2.2

Expand Down
2 changes: 1 addition & 1 deletion frontends/rioterm/src/bindings/kitty_keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub fn build_key_sequence(key: &KeyEvent, mods: ModifiersState, mode: Mode) -> V
let sequence_base = context
.try_build_numpad(key)
.or_else(|| context.try_build_named_kitty(key))
.or_else(|| context.try_build_named_normal(&key, associated_text.is_some()))
.or_else(|| context.try_build_named_normal(key, associated_text.is_some()))
.or_else(|| context.try_build_control_char_or_mod(key, &mut modifiers))
.or_else(|| context.try_build_textual(key, associated_text));

Expand Down
5 changes: 3 additions & 2 deletions rio-window/src/platform_impl/windows/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ use windows_sys::Win32::UI::WindowsAndMessaging::{
PostMessageW, RegisterClassExW, RegisterWindowMessageA, SetCursor, SetWindowPos,
TranslateMessage, CREATESTRUCTW, GIDC_ARRIVAL, GIDC_REMOVAL, GWL_STYLE, GWL_USERDATA,
HTCAPTION, HTCLIENT, MINMAXINFO, MNC_CLOSE, MSG, MWMO_INPUTAVAILABLE,
NCCALCSIZE_PARAMS, PM_REMOVE, PT_PEN, PT_TOUCH, QS_ALLEVENTS, RI_MOUSE_HWHEEL,
NCCALCSIZE_PARAMS, PM_REMOVE, PT_PEN, 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,
Expand Down Expand Up @@ -788,11 +788,12 @@ fn wait_for_messages_impl(
(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 _,
wait_duration_ms,
QS_ALLEVENTS,
QS_ALLINPUT,
MWMO_INPUTAVAILABLE,
);
if result == WAIT_FAILED {
Expand Down

0 comments on commit 5bc94a3

Please sign in to comment.