From 5ca1534ba31eeaf26ead094743f6bf8a034131ff Mon Sep 17 00:00:00 2001 From: AstralZX <208268648+AstralZX@users.noreply.github.com> Date: Sat, 29 Aug 2026 09:39:23 +0200 Subject: [PATCH] testWM: don't attach keyboard devices to the cursor --- examples/testwm.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/testwm.cpp b/examples/testwm.cpp index be42f26..41e4748 100644 --- a/examples/testwm.cpp +++ b/examples/testwm.cpp @@ -243,7 +243,6 @@ static void on_new_output(void* data) { static void on_new_input(void* data) { auto* dev = static_cast(data); - S->cursor.attach_input_device(dev); if (dev->type == WLR_INPUT_DEVICE_KEYBOARD) { struct wlr_keyboard* kb = wlr_keyboard_from_input_device(dev); wlr::Keyboard k(kb); @@ -252,8 +251,12 @@ static void on_new_input(void* data) { S->seat.set_keyboard(k); S->key_sink.connect(&kb->events.key, on_key); S->caps |= WL_SEAT_CAPABILITY_KEYBOARD; - } else if (dev->type == WLR_INPUT_DEVICE_POINTER) { - S->caps |= WL_SEAT_CAPABILITY_POINTER; + } else { + S->cursor.attach_input_device(dev); + if (dev->type == WLR_INPUT_DEVICE_POINTER) + S->caps |= WL_SEAT_CAPABILITY_POINTER; + else if (dev->type == WLR_INPUT_DEVICE_TOUCH) + S->caps |= WL_SEAT_CAPABILITY_TOUCH; } S->seat.set_capabilities((uint32_t)S->caps); }