[Bug] Fix layer_state
restoration at end of dynamic macro feature #16208
#16230
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.
By doing so, methods like 'layer_state_set_user' will be called, ensuring a correct behavior.
Description
This is a fix for #16208.
Restoring the layer state using
layer_state = saved_layer_state
doesn't call methods likelayer_state_set_user
leading to strange behavior (like shutting down the leds on the moonlander)Types of Changes
Issues Fixed or Closed by This PR
Checklist
Note regarding tests: the original fix has been made on the zsa fork. A firmware has been build and tested
layer_state_set_user
is now called two times (from layer 0 then go back to actual layer)To make this PR I've:
make test:all
(everything is OK)