git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commitb4899b82d0d9200da8c5d1fdc7c24ec32f115ba9
parentda5cac5d76
authorIsaac Freund <[email protected]>
date2026-03-10 16:13
xkb-config: don't expose virtual keyboards

These were only exposed by accident.

 river/InputDevice.zig | 6 +++---
 river/XkbKeyboard.zig | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/river/InputDevice.zig b/river/InputDevice.zig
index afca476..9f53c91 100644
--- a/river/InputDevice.zig
+++ b/river/InputDevice.zig
@@ -76,6 +76,9 @@ pub fn init(
         if (wlr_device.getLibinputDevice()) |handle| {
             device.libinput.init(@ptrCast(handle));
         }
+        if (wlr_device.type == .keyboard) {
+            device.xkb_keyboard.init();
+        }
     }
 
     // The wlroots Wayland and X11 backends support multiple outputs
@@ -96,9 +99,6 @@ pub fn init(
             }
         }
     }
-    if (wlr_device.type == .keyboard) {
-        device.xkb_keyboard.init();
-    }
 }
 
 pub fn createObject(device: *InputDevice, im_v1: *river.InputManagerV1) void {
diff --git a/river/XkbKeyboard.zig b/river/XkbKeyboard.zig
index c00c8f9..0921bc6 100644
--- a/river/XkbKeyboard.zig
+++ b/river/XkbKeyboard.zig
@@ -57,6 +57,7 @@ pub fn createObject(xkb_keyboard: *XkbKeyboard, config_v1: *river.XkbConfigV1) v
     config_v1.sendXkbKeyboard(object);
     {
         const device: *InputDevice = @fieldParentPtr("xkb_keyboard", xkb_keyboard);
+        assert(!device.virtual);
         var it = device.objects.iterator(.forward);
         while (it.next()) |input_device_v1| {
             if (object.getClient() == input_device_v1.getClient()) {