mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-04-08 08:21:12 -04:00
virtual keyboards: add virtual keyboards to seat list
Without adding the keyboard to seat list we wouldn't properly declare keyboard capability, making the keyboard not work in headless mode. We actually need to free this at some point so adding to the list is most sensible, but we still do not want to group virtual keyboards with regular ones so add a new 'is_virtual' bool to cg_keyboard_group so we can skip these for grouping.
This commit is contained in:
parent
25a025c6fb
commit
11d5284e83
2 changed files with 5 additions and 4 deletions
8
seat.c
8
seat.c
|
|
@ -320,6 +320,8 @@ cg_keyboard_group_add(struct wlr_input_device *device, struct cg_seat *seat, boo
|
|||
|
||||
struct cg_keyboard_group *group;
|
||||
wl_list_for_each (group, &seat->keyboard_groups, link) {
|
||||
if (group->is_virtual)
|
||||
continue;
|
||||
struct wlr_keyboard_group *wlr_group = group->wlr_group;
|
||||
if (wlr_keyboard_group_add_keyboard(wlr_group, wlr_keyboard)) {
|
||||
wlr_log(WLR_DEBUG, "Added new keyboard to existing group");
|
||||
|
|
@ -337,6 +339,7 @@ create_new:
|
|||
return;
|
||||
}
|
||||
cg_group->seat = seat;
|
||||
cg_group->is_virtual = virtual;
|
||||
cg_group->wlr_group = wlr_keyboard_group_create();
|
||||
if (cg_group->wlr_group == NULL) {
|
||||
wlr_log(WLR_ERROR, "Failed to create wlr keyboard group.");
|
||||
|
|
@ -352,10 +355,7 @@ create_new:
|
|||
wlr_log(WLR_DEBUG, "Created keyboard group");
|
||||
|
||||
wlr_keyboard_group_add_keyboard(cg_group->wlr_group, wlr_keyboard);
|
||||
if (!virtual)
|
||||
wl_list_insert(&seat->keyboard_groups, &cg_group->link);
|
||||
else
|
||||
wl_list_init(&cg_group->link);
|
||||
wl_list_insert(&seat->keyboard_groups, &cg_group->link);
|
||||
|
||||
wl_signal_add(&cg_group->wlr_group->keyboard.events.key, &cg_group->key);
|
||||
cg_group->key.notify = handle_keyboard_group_key;
|
||||
|
|
|
|||
1
seat.h
1
seat.h
|
|
@ -61,6 +61,7 @@ struct cg_keyboard_group {
|
|||
struct wl_listener key;
|
||||
struct wl_listener modifiers;
|
||||
struct wl_list link; // cg_seat::keyboard_groups
|
||||
bool is_virtual;
|
||||
};
|
||||
|
||||
struct cg_pointer {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue