]> git.mdlowis.com Git - proto/labwc.git/commitdiff
ime: don't use data argument in some signal handlers
authortokyo4j <hrak1529@gmail.com>
Sun, 6 Jul 2025 20:15:46 +0000 (05:15 +0900)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Tue, 5 Aug 2025 02:43:09 +0000 (11:43 +0900)
In wlroots 0.20, the those data argument will be just NULL.

src/input/ime.c

index 350374df72f401e91aaba36f4216d53e6d022fad..cf8cd2d9b705e096a999f597f18d7f3a9eed14ab 100644 (file)
@@ -270,8 +270,7 @@ handle_input_method_commit(struct wl_listener *listener, void *data)
 {
        struct input_method_relay *relay =
                wl_container_of(listener, relay, input_method_commit);
-       struct wlr_input_method_v2 *input_method = data;
-       assert(relay->input_method == input_method);
+       struct wlr_input_method_v2 *input_method = relay->input_method;
 
        struct text_input *text_input = relay->active_text_input;
        if (!text_input) {
@@ -305,7 +304,9 @@ 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;
+
        wl_list_remove(&relay->keyboard_grab_destroy.link);
 
        if (keyboard_grab->keyboard) {
@@ -343,7 +344,6 @@ handle_input_method_destroy(struct wl_listener *listener, void *data)
 {
        struct input_method_relay *relay =
                wl_container_of(listener, relay, input_method_destroy);
-       assert(relay->input_method == data);
        wl_list_remove(&relay->input_method_commit.link);
        wl_list_remove(&relay->input_method_grab_keyboard.link);
        wl_list_remove(&relay->input_method_new_popup_surface.link);