Skip to content

Commit

Permalink
fix: always call layer_state_set_user
Browse files Browse the repository at this point in the history
Before commit b46f5e2,
layer_state_set_kb was only defined if MOONLANDER_USER_LEDS was not set.
With MOONLANDER_USER_LEDS set, the default layer_state_set_kb provided
by QMK takes care of calling layer_state_set_user.

After that commit, layer_state_set_kb is defined unconditionally, but
most of its body is still ifdef'd out if MOONLANDER_USER_LEDS is set.
That includes layer_state_set_user, which looks like an oversight.

Run layer_state_set_user unconditionally.

This is the same fix as zsa#396 for voyager. It looks like the other ZSA
keyboards do not have the same problem.

Alternatively, we could go back to the old approach of defining the
function conditionally, but this makes it a little harder to reintroduce
the same problem.
  • Loading branch information
marienz committed Dec 6, 2024
1 parent 4ae6ea9 commit d2de978
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion keyboards/zsa/moonlander/moonlander.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ void keyboard_pre_init_kb(void) {
}

layer_state_t layer_state_set_kb(layer_state_t state) {
#if !defined(MOONLANDER_USER_LEDS)
state = layer_state_set_user(state);
#if !defined(MOONLANDER_USER_LEDS)
# ifdef ORYX_ENABLE
layer_state_set_oryx(state);
if (rawhid_state.status_led_control) return state;
Expand Down

0 comments on commit d2de978

Please sign in to comment.