mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-02 06:46:29 -04:00
Merge 06557ae3c1 into b9c6a2c196
This commit is contained in:
commit
c99cf7f20e
1 changed files with 9 additions and 2 deletions
11
src/mango.c
11
src/mango.c
|
|
@ -449,6 +449,7 @@ typedef struct {
|
|||
struct wl_listener modifiers;
|
||||
struct wl_listener key;
|
||||
struct wl_listener destroy;
|
||||
xkb_layout_index_t last_group;
|
||||
} KeyboardGroup;
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -2818,6 +2819,7 @@ KeyboardGroup *createkeyboardgroup(void) {
|
|||
|
||||
group->wlr_group = wlr_keyboard_group_create();
|
||||
group->wlr_group->data = group;
|
||||
group->last_group = XKB_LAYOUT_INVALID;
|
||||
|
||||
context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
|
||||
if (!(keymap = xkb_keymap_new_from_names(context, &config.xkb_rules,
|
||||
|
|
@ -3967,13 +3969,18 @@ void keypressmod(struct wl_listener *listener, void *data) {
|
|||
/* This event is raised when a modifier key, such as shift or alt, is
|
||||
* pressed. We simply communicate this to the client. */
|
||||
KeyboardGroup *group = wl_container_of(listener, group, modifiers);
|
||||
struct wlr_keyboard_modifiers *mods = &group->wlr_group->keyboard.modifiers;
|
||||
|
||||
if (!dwl_im_keyboard_grab_forward_modifiers(group)) {
|
||||
|
||||
wlr_seat_set_keyboard(seat, &group->wlr_group->keyboard);
|
||||
/* Send modifiers to the client. */
|
||||
wlr_seat_keyboard_notify_modifiers(
|
||||
seat, &group->wlr_group->keyboard.modifiers);
|
||||
wlr_seat_keyboard_notify_modifiers(seat, mods);
|
||||
}
|
||||
|
||||
if (mods->group != group->last_group) {
|
||||
group->last_group = mods->group;
|
||||
printstatus();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue