fix(windows): add apply actions call to core_event#15867
Open
rc-swag wants to merge 3 commits intofix/windows/15594/caps-lock-stores-change-filtersfrom
Open
fix(windows): add apply actions call to core_event#15867rc-swag wants to merge 3 commits intofix/windows/15594/caps-lock-stores-change-filtersfrom
rc-swag wants to merge 3 commits intofix/windows/15594/caps-lock-stores-change-filtersfrom
Conversation
add apply_actions_and_merge_app_context to km_core_event parent. This ensures any actions as result of the km_core_event are applied and actions object updated. Fixes:#15857
User Test ResultsTest specification and instructions
Results TemplateTest Artifacts |
ermshiperete
approved these changes
Apr 23, 2026
Contributor
Author
|
I have added call to the constructor because I believe construction should have the correct state. |
ermshiperete
approved these changes
Apr 27, 2026
mcdurdin
approved these changes
Apr 28, 2026
Member
mcdurdin
left a comment
There was a problem hiding this comment.
LGTM. This should probably be ported to 18.0
Member
|
(Note: need to fix failing state-api-test) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem was actually the fact that the
memset(const_cast<km_core_actions*>(&_action_struct), 0, sizeof(km_core_actions));call in state.cpp initialisation means the object is zeroed out and results innew_caps_lock_state == KM_CORE_CAPS_OFF. This bug would have been a regresion from when we use to have an actions list. Callingapply_actions_and_merge_app_contextwhich then callsaction_item_list_to_actions_objectthe top of this function sets all the actions default values.So in this case calling it means the _action_struct is correctly initialised, event though no actions were added.
I think we should consider making a helper
km::core::set_action_defaultswhich is called on contstruction just after the memset zeroing.add apply_actions_and_merge_app_context to km_core_event parent. This ensures any actions as result of the km_core_event are applied and actions object updated.
Fixes:#15857
User Testing
TEST_CAPS_STAYS_ON
Use the
capslock.kmp.zipkeyboard.Starting an app Word or Notepad, Keyman is running but a Non-Keyman keyboard is selected.
Press the
CapsLockkey verify the Caplock indicator light is on.Select the Keyboard named
Capslockwithout pressing any other key.Ensuring the app still has focus verify the CapsLock Indicator remains on.
Repeat to ensure it continues to behave as expected not turning of the indicator when selecting the
CapslockKeyman keyboard. Or any keyboard that doesn't have capsallwaysoff store.TEST_CAPS_ALWAYS_OFF
Use a keyboard with the
caps_always_off.kmp.zipstore setInstall Caps Always Off keyboard.
Starting an app Word or Notepad, Keyman is running but a Non-Keyman keyboard is selected.
Select the Keyboard named
Caps Always Offwithout pressing any other key.Ensuring the app still has focus verify the CapsLock Indicator turns OFF.
Repeat to ensure it continues to behave as expected, turning of the indicator off when selecting the
Caps Always offKeyman keyboard.