Skip to content

Commit

Permalink
Merge branch 'main' into csi-i
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim authored Dec 25, 2024
2 parents 5f4d88c + 5bc94a3 commit 32c51bc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions docs/docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ language: 'en'
- Allow `Renderer` to be configured cross-platform by `Platform` property.
- Add `ToggleFullscreen` to configurable actions.
- Support for `CSI n I` (Cursor Forward Tabulation) to move the cursor forward by a specified number of tabs.
- 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
13 changes: 10 additions & 3 deletions 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))
.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 Expand Up @@ -263,14 +263,21 @@ impl SequenceBuilder {
}

/// Try building from [`NamedKey`].
fn try_build_named_normal(&self, key: &KeyEvent) -> Option<SequenceBase> {
fn try_build_named_normal(
&self,
key: &KeyEvent,
has_associated_text: bool,
) -> Option<SequenceBase> {
let named = match key.logical_key {
Key::Named(named) => named,
_ => return None,
};

// The default parameter is 1, so we can omit it.
let one_based = if self.modifiers.is_empty() && !self.kitty_event_type {
let one_based = if self.modifiers.is_empty()
&& !self.kitty_event_type
&& !has_associated_text
{
""
} else {
"1"
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 32c51bc

Please sign in to comment.