summaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authorMikhail Burakov <mburakov@mailbox.org>2023-04-02 20:45:16 +0200
committerMikhail Burakov <mburakov@mailbox.org>2023-04-07 13:48:06 +0200
commit779b65bc22e0463f42161f0e03fee2cef9b2d790 (patch)
tree29d252c1615c0d792bd2b1e2daf5ea556d09e7e2 /window.c
parent0107291f780228edd3bae34cca59974a5734feda (diff)
Implement support for keyboard events
Diffstat (limited to 'window.c')
-rw-r--r--window.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/window.c b/window.c
index ff54f70..b7ae0ec 100644
--- a/window.c
+++ b/window.c
@@ -197,11 +197,12 @@ static void OnWlKeyboardKeymap(void* data, struct wl_keyboard* wl_keyboard,
static void OnWlKeyboardEnter(void* data, struct wl_keyboard* wl_keyboard,
uint32_t serial, struct wl_surface* surface,
struct wl_array* keys) {
- (void)data;
(void)wl_keyboard;
(void)serial;
(void)surface;
(void)keys;
+ struct Window* window = data;
+ window->event_handlers->OnFocus(window->user, true);
}
static void OnWlKeyboardLeave(void* data, struct wl_keyboard* wl_keyboard,
@@ -210,6 +211,8 @@ static void OnWlKeyboardLeave(void* data, struct wl_keyboard* wl_keyboard,
(void)wl_keyboard;
(void)serial;
(void)surface;
+ struct Window* window = data;
+ window->event_handlers->OnFocus(window->user, false);
}
static void OnWlKeyboardKey(void* data, struct wl_keyboard* wl_keyboard,