From 8a552a1af9695de1a60504aa26bbad21a133811c Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Sat, 18 Oct 2025 16:32:20 +0900 Subject: [PATCH] chase wlroots: ime: don't use `data` in kb grab destroy handler (MR 5170) Ref: 06275103f249cd2954630e59383342e102a6c1a3 (input-method-v2: Destroy keyboard grab before input method) Background: My MR in wlroots (!5107) stopped emitting `wlr_input_method_v2` on its `commit`/`destroy` events, but didn't stop emitting `wlr_input_method_keyboard_grab_v2` on its `destroy` event. That was because `handle_keyboard_grab_destroy()` was called *after* `handle_input_method_destroy()` for some reason, which caused segfault when dereferencing `relay->input_method.keyboard_grab` in `handle_keyboard_grab_destroy()`. MR 5170 reversed this weired order of destroy handler calls, and finally stopped emitting `wlr_input_method_keyboard_grab_v2` on its `destroy` event. --- src/input/ime.c | 3 ++- subprojects/wlroots.wrap | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/input/ime.c b/src/input/ime.c index bfb8816f..efbe54d6 100644 --- a/src/input/ime.c +++ b/src/input/ime.c @@ -309,7 +309,8 @@ handle_keyboard_grab_destroy(struct wl_listener *listener, void *data) { struct input_method_relay *relay = wl_container_of(listener, relay, keyboard_grab_destroy); - struct wlr_input_method_keyboard_grab_v2 *keyboard_grab = data; + struct wlr_input_method_keyboard_grab_v2 *keyboard_grab = + relay->input_method->keyboard_grab; assert(keyboard_grab); wl_list_remove(&relay->keyboard_grab_destroy.link); diff --git a/subprojects/wlroots.wrap b/subprojects/wlroots.wrap index 253b83d7..18e5ef98 100644 --- a/subprojects/wlroots.wrap +++ b/subprojects/wlroots.wrap @@ -1,6 +1,6 @@ [wrap-git] url = https://gitlab.freedesktop.org/wlroots/wlroots.git -revision = 06aacb2a6fd237a5e1062d611909432bbcf5b566 +revision = 06275103f249cd2954630e59383342e102a6c1a3 [provide] dependency_names = wlroots-0.20