diff options
| author | Daniel Stone <daniel@fooishbar.org> | 2012-05-30 16:31:47 +0100 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-05-31 14:01:56 -0400 |
| commit | 9a1705c5f5e877d4e68bd0e7eb858f517375ba3f (patch) | |
| tree | 0a6a99e25a0c9aae5731f8a28d9c1470a9398c21 /src/wayland-server.c | |
| parent | Always reset keyboard and pointer focus (diff) | |
| download | wayland-9a1705c5f5e877d4e68bd0e7eb858f517375ba3f.tar wayland-9a1705c5f5e877d4e68bd0e7eb858f517375ba3f.tar.gz wayland-9a1705c5f5e877d4e68bd0e7eb858f517375ba3f.tar.bz2 wayland-9a1705c5f5e877d4e68bd0e7eb858f517375ba3f.tar.lz wayland-9a1705c5f5e877d4e68bd0e7eb858f517375ba3f.tar.xz wayland-9a1705c5f5e877d4e68bd0e7eb858f517375ba3f.tar.zst wayland-9a1705c5f5e877d4e68bd0e7eb858f517375ba3f.zip | |
wl_keyboard: Add modifier event
This event sends the current keyboard modifier/group state from the
compositor to the client, allowing all clients to have a consistent view
of the keyboard state (e.g. current layout, Caps Lock, et al). It
should be sent after a keyboard enter event, and also immediately after
any key event which changes the modifier state.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'src/wayland-server.c')
| -rw-r--r-- | src/wayland-server.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/wayland-server.c b/src/wayland-server.c index d4a70cf..323d32d 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -532,9 +532,26 @@ default_grab_key(struct wl_keyboard_grab *grab, } } +static void +default_grab_modifiers(struct wl_keyboard_grab *grab, uint32_t serial, + uint32_t mods_depressed, uint32_t mods_latched, + uint32_t mods_locked, uint32_t group) +{ + struct wl_keyboard *keyboard = grab->keyboard; + struct wl_resource *resource; + + resource = keyboard->focus_resource; + if (!resource) + return; + + wl_keyboard_send_modifiers(resource, serial, mods_depressed, + mods_latched, mods_locked, group); +} + static const struct wl_keyboard_grab_interface default_keyboard_grab_interface = { - default_grab_key + default_grab_key, + default_grab_modifiers, }; WL_EXPORT void |
