diff --git a/cage.c b/cage.c index 2b75807..a4f05dd 100644 --- a/cage.c +++ b/cage.c @@ -61,8 +61,6 @@ #include "xwayland.h" #endif -extern bool numlock; - void server_terminate(struct cg_server *server) { @@ -264,7 +262,7 @@ parse_args(struct cg_server *server, int argc, char *argv[]) } break; case 'n': - numlock = true; + server->numlock = true; break; case 's': server->allow_vt_switch = true; diff --git a/seat.c b/seat.c index 28dce9f..7b5f927 100644 --- a/seat.c +++ b/seat.c @@ -45,7 +45,6 @@ #endif static uint32_t locked_mods = 0; -bool numlock = false; static void drag_icon_update_position(struct cg_drag_icon *drag_icon); @@ -362,7 +361,7 @@ cg_keyboard_group_add(struct wlr_keyboard *keyboard, struct cg_seat *seat, bool cg_group->wlr_group->data = cg_group; wlr_keyboard_set_keymap(&cg_group->wlr_group->keyboard, keyboard->keymap); - if (numlock) { + if (seat->server->numlock) { xkb_mod_index_t mod_index = xkb_keymap_mod_get_index(keyboard->keymap, XKB_MOD_NAME_NUM); if (mod_index != XKB_MOD_INVALID) locked_mods |= (uint32_t)1 << mod_index; diff --git a/server.h b/server.h index 00c2a61..3ced4de 100644 --- a/server.h +++ b/server.h @@ -65,6 +65,7 @@ struct cg_server { bool allow_vt_switch; bool return_app_code; bool terminated; + bool numlock; enum wlr_log_importance log_level; };