Skip to content

Windows hardening - #124

Open
waywardmonkeys wants to merge 9 commits into
mainfrom
windows-hardening
Open

waywardmonkeys wants to merge 9 commits into
mainfrom
windows-hardening

Conversation

@waywardmonkeys

Copy link
Copy Markdown
Collaborator

This is to see if CI passes and allow @RagibHasin to see some of what might be useful.

RagibHasin and others added 9 commits July 13, 2026 23:14
Bind each reducer to one HWND and return normalized input together with an explicit window-procedure response. Consume WM_TOUCH after closing its native handle, preserve the required TRUE result for handled X-button messages, and expose a single recognized-message table for hosts.
Decode signed coordinates from each button and wheel message, clear pressed state when capture is stolen, and keep tap counters scoped to the affected pointer. Offset touch IDs past the reserved primary ID and suppress legacy mouse messages promoted from touch input.
Honor the core ScrollDelta navigation-direction contract across the Windows and winit adapters. Preserve the Windows page-scroll preference as PageDelta, suppress disabled scrolling, and read system preferences through the correct UINT representation.
Preserve ToUnicode output without mutating keyboard state, distinguish modifier sides and AltGr, and report composition state on key events. Translate WM_CHAR UTF-16 and retain both IME result and composition updates from combined messages.
Add per-window IME activation and cursor-area controls, preserve native candidate UI while suppressing application-rendered preedit UI, and reapply geometry across scale changes. Track IME session and preedit state separately so disabling and late Hangul commits produce coherent text-event ordering.
Add ui-events-windows to the MSRV and generated README checks, and build its public documentation on a native Windows runner.
Comment on lines +76 to +78
const SIGNATURE_MASK: usize = 0xffff_ff00;
const MI_WP_SIGNATURE: usize = 0xff51_5700;
const MI_WP_TOUCH: usize = 0x80;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do these come from?

struct ImeContext<'m> {
hwnd: HWND,
himc: HIMC,
_lifetime: PhantomData<&'m ()>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this _lifetime is superfluous. I tried this to ensure that the context is live for the duration of lparam but I don't think that can be encoded like this.

};
use ui_events::{ScrollDelta, text::TextInputEvent};
use ui_events::{
ScrollDelta,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe split it?

@RagibHasin

Copy link
Copy Markdown

Having getters for WindowMessageReducer::hwnd and WindowMessageReducer::scale_factor would reduce duplication in downstream window state objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants