]> git.mdlowis.com Git - proto/labwc.git/commitdiff
ime: revert workarounds for wlroots 0.18.2
authortokyo4j <hrak1529@gmail.com>
Mon, 23 Jun 2025 19:32:40 +0000 (04:32 +0900)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Wed, 25 Jun 2025 18:20:11 +0000 (03:20 +0900)
The workarounds added in #2498 and #2437 fixed stuck key/modifier bug
caused by wlroots commit e218990. But now that the commit was reverted in
0.19, the workarounds are no longer needed.

Removing the workarounds also fixes a minor regression with Fcitx5+Firefox
that pressing Ctrl+Enter in an input box causes stuck modifier.

include/input/ime.h
src/input/ime.c

index 01ea8ecd214a52b7585447e53031ed208c59a2d4..fcd292cee0c9aea87ed984f47109b38fac1aeabf 100644 (file)
@@ -22,9 +22,6 @@ struct input_method_relay {
        struct wlr_input_method_v2 *input_method;
        struct wlr_surface *focused_surface;
 
-       struct lab_set forwarded_pressed_keys;
-       struct wlr_keyboard_modifiers forwarded_modifiers;
-
        /*
         * Text-input which is enabled by the client and communicating with
         * input-method.
index 2a6c3b453b92fa701b55d0949085cc645cdd0bda..ded28f5ce5064d29c7c5499e742583c4d371a4f0 100644 (file)
@@ -59,24 +59,11 @@ input_method_keyboard_grab_forward_modifiers(struct keyboard *keyboard)
        struct wlr_input_method_keyboard_grab_v2 *keyboard_grab =
                get_keyboard_grab(keyboard);
 
-       struct wlr_keyboard_modifiers *forwarded_modifiers =
-               &keyboard->base.seat->input_method_relay->forwarded_modifiers;
-       struct wlr_keyboard_modifiers *modifiers =
-               &keyboard->wlr_keyboard->modifiers;
-
-       if (forwarded_modifiers->depressed == modifiers->depressed
-                       && forwarded_modifiers->latched == modifiers->latched
-                       && forwarded_modifiers->locked == modifiers->locked
-                       && forwarded_modifiers->group == modifiers->group) {
-               return false;
-       }
-
        if (keyboard_grab) {
-               *forwarded_modifiers = keyboard->wlr_keyboard->modifiers;
                wlr_input_method_keyboard_grab_v2_set_keyboard(keyboard_grab,
                        keyboard->wlr_keyboard);
                wlr_input_method_keyboard_grab_v2_send_modifiers(keyboard_grab,
-                       modifiers);
+                       &keyboard->wlr_keyboard->modifiers);
                return true;
        } else {
                return false;
@@ -87,25 +74,9 @@ bool
 input_method_keyboard_grab_forward_key(struct keyboard *keyboard,
                struct wlr_keyboard_key_event *event)
 {
-       /*
-        * We should not forward key-release events without corresponding
-        * key-press events forwarded
-        */
-       struct lab_set *pressed_keys =
-               &keyboard->base.seat->input_method_relay->forwarded_pressed_keys;
-       if (event->state == WL_KEYBOARD_KEY_STATE_RELEASED
-                       && !lab_set_contains(pressed_keys, event->keycode)) {
-               return false;
-       }
-
        struct wlr_input_method_keyboard_grab_v2 *keyboard_grab =
                get_keyboard_grab(keyboard);
        if (keyboard_grab) {
-               if (event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
-                       lab_set_add(pressed_keys, event->keycode);
-               } else {
-                       lab_set_remove(pressed_keys, event->keycode);
-               }
                wlr_input_method_keyboard_grab_v2_set_keyboard(keyboard_grab,
                        keyboard->wlr_keyboard);
                wlr_input_method_keyboard_grab_v2_send_key(keyboard_grab,
@@ -357,9 +328,6 @@ handle_input_method_grab_keyboard(struct wl_listener *listener, void *data)
                        keyboard_grab, active_keyboard);
        }
 
-       relay->forwarded_pressed_keys = (struct lab_set){0};
-       relay->forwarded_modifiers = (struct wlr_keyboard_modifiers){0};
-
        relay->keyboard_grab_destroy.notify = handle_keyboard_grab_destroy;
        wl_signal_add(&keyboard_grab->events.destroy,
                &relay->keyboard_grab_destroy);