mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-03-21 05:33:55 -04:00
optimize: change numlock var into server
This commit is contained in:
parent
aa54758e75
commit
4b7ef5287a
3 changed files with 3 additions and 5 deletions
4
cage.c
4
cage.c
|
|
@ -61,8 +61,6 @@
|
||||||
#include "xwayland.h"
|
#include "xwayland.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern bool numlock;
|
|
||||||
|
|
||||||
void
|
void
|
||||||
server_terminate(struct cg_server *server)
|
server_terminate(struct cg_server *server)
|
||||||
{
|
{
|
||||||
|
|
@ -264,7 +262,7 @@ parse_args(struct cg_server *server, int argc, char *argv[])
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
numlock = true;
|
server->numlock = true;
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
server->allow_vt_switch = true;
|
server->allow_vt_switch = true;
|
||||||
|
|
|
||||||
3
seat.c
3
seat.c
|
|
@ -45,7 +45,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static uint32_t locked_mods = 0;
|
static uint32_t locked_mods = 0;
|
||||||
bool numlock = false;
|
|
||||||
|
|
||||||
static void drag_icon_update_position(struct cg_drag_icon *drag_icon);
|
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;
|
cg_group->wlr_group->data = cg_group;
|
||||||
wlr_keyboard_set_keymap(&cg_group->wlr_group->keyboard, keyboard->keymap);
|
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);
|
xkb_mod_index_t mod_index = xkb_keymap_mod_get_index(keyboard->keymap, XKB_MOD_NAME_NUM);
|
||||||
if (mod_index != XKB_MOD_INVALID)
|
if (mod_index != XKB_MOD_INVALID)
|
||||||
locked_mods |= (uint32_t)1 << mod_index;
|
locked_mods |= (uint32_t)1 << mod_index;
|
||||||
|
|
|
||||||
1
server.h
1
server.h
|
|
@ -65,6 +65,7 @@ struct cg_server {
|
||||||
bool allow_vt_switch;
|
bool allow_vt_switch;
|
||||||
bool return_app_code;
|
bool return_app_code;
|
||||||
bool terminated;
|
bool terminated;
|
||||||
|
bool numlock;
|
||||||
enum wlr_log_importance log_level;
|
enum wlr_log_importance log_level;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue