Commit graph

3 commits

Author SHA1 Message Date
Marc Durdin
2c7bba8d10 refactor(windows): cleanup unused wm_keyman_control values
Cleanup of unused `wm_keyman_control` and `wm_keyman_refresh` values,
and some other unused messages, which were making the implementation
harder to understand.

Relates-to: #15333
Follows: #16435
2026-08-26 10:18:00 +02:00
Marc Durdin
0e332b6f6c fix(windows): simplify keyboard refresh and make it more on-demand
Some checks are pending
Keyman Build Summary / Summarize build status checks (push) Waiting to run
Clean up the keyboard refresh process. Keyman COM API will post a
`wm_keyman_refresh`, `KR_REQUEST_REFRESH` message when changes have been
made to the list of installed keyboards (or some other keyboard-related
settings change).

Keyman Engine (any arch) will handle this message, in any process, and
post a message to the master controller (keyman.exe, TfrmKeyman7Main),
`wm_keyman_refresh`, `KR_PRE_REFRESH`.

Keyman Engine (keyman32) will handle _this_ message in the master
controller thread context, and increment the global refresh tag. It also
asks the other architecture host process(es) to update their global
refresh counter to the same value (by posting `wm_keyman_refresh`,
`KM_PRE_REFRESH` to those process(es).)

This refresh tag is then compared on-demand in each thread to the
thread's current refresh tag value, when a keyboard activation is
received, on set focus, or on a keystroke, and the keyboard list is
refreshed at that point.

This means that keyboard installation no longer triggers a large amount
of activity reloading all the keyboards on all windowed threads, but
rather they will gradually reload as the user interacts with them. It
also fixes #15333, which related to having threads with only child
windows -- that is, that were parented by top-level windows from other
threads -- which thus never received the global broadcast in the earlier
design. For example, VSCode, Notepad in Win11, Chrome.

Fixes: #15333
2026-08-26 10:15:46 +02:00
Marc Durdin
ae0810bc5e chore(windows): move kmtip_guids.h and testkeymanfunctioning.h 2022-06-12 07:43:24 +10:00