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

commitb1a53b4061856295bc5bccc6fe9ea66a8e83f2a2
parent3b4b737f77
authorIsaac Freund <[email protected]>
date2026-03-28 11:00
InputRelay: adapt to wlroots breaking change

This wlroots breaking change wasn't mentioned in the changelog :/

Fixes a crash when doing pretty much anything with an input method.

 build.zig.zon        |  4 ++--
 river/InputRelay.zig | 11 +++++------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/build.zig.zon b/build.zig.zon
index 1f10100..44a6fc4 100644
--- a/build.zig.zon
+++ b/build.zig.zon
@@ -20,8 +20,8 @@
             .hash = "wayland-0.5.0-lQa1knz8AQCh08NA8BeQrwJB9U3CfqcVAdHZYGRKIGuu",
         },
         .wlroots = .{
-            .url = "git+https://codeberg.org/ifreund/zig-wlroots?ref=master#6ffee8b21d24e0e4aadcf204f65ebe7ad3c3bacf",
-            .hash = "wlroots-0.20.0-dev-jmOlclseBABjKSxVH4TVkN4Fm-moidbybTStGsujJU_m",
+            .url = "git+https://codeberg.org/ifreund/zig-wlroots?ref=master#149c17476ccec90b9904d6a1a8d38858d4ac925f",
+            .hash = "wlroots-0.20.0-dev-jmOlckAeBACoYWj_Hs3JdREUrmKQDTj3d_P76C1HAHgz",
         },
         .xkbcommon = .{
             .url = "https://codeberg.org/ifreund/zig-xkbcommon/archive/v0.4.0.tar.gz",
diff --git a/river/InputRelay.zig b/river/InputRelay.zig
index 007a7bf..e920c48 100644
--- a/river/InputRelay.zig
+++ b/river/InputRelay.zig
@@ -37,7 +37,7 @@ grab_keyboard: wl.Listener(*wlr.InputMethodV2.KeyboardGrab) = .init(handleInputM
 input_method_destroy: wl.Listener(void) = .init(handleInputMethodDestroy),
 input_method_new_popup: wl.Listener(*wlr.InputPopupSurfaceV2) = .init(handleInputMethodNewPopup),
 
-grab_keyboard_destroy: wl.Listener(*wlr.InputMethodV2.KeyboardGrab) = .init(handleInputMethodGrabKeyboardDestroy),
+grab_keyboard_destroy: wl.Listener(void) = .init(handleInputMethodGrabKeyboardDestroy),
 
 pub fn init(relay: *InputRelay) void {
     relay.* = .{ .text_inputs = undefined, .input_popups = undefined };
@@ -140,15 +140,14 @@ fn handleInputMethodNewPopup(
     };
 }
 
-fn handleInputMethodGrabKeyboardDestroy(
-    listener: *wl.Listener(*wlr.InputMethodV2.KeyboardGrab),
-    keyboard_grab: *wlr.InputMethodV2.KeyboardGrab,
-) void {
+fn handleInputMethodGrabKeyboardDestroy(listener: *wl.Listener(void)) void {
     const relay: *InputRelay = @fieldParentPtr("grab_keyboard_destroy", listener);
+    const input_method = relay.input_method.?;
+    const keyboard_grab = input_method.keyboard_grab.?;
     relay.grab_keyboard_destroy.link.remove();
 
     if (keyboard_grab.keyboard) |keyboard| {
-        keyboard_grab.input_method.seat.keyboardNotifyModifiers(&keyboard.modifiers);
+        input_method.seat.keyboardNotifyModifiers(&keyboard.modifiers);
     }
 }