wayland: fix direct keyboard input device selection
This commit is contained in:
parent
2c1dca387f
commit
6a12e3ea5a
|
|
@ -148,8 +148,6 @@ handle_backend_new_input(struct wl_listener *listener, void *data)
|
|||
switch (dev->type) {
|
||||
case WLR_INPUT_DEVICE_KEYBOARD: {
|
||||
struct wlr_keyboard *kb = wlr_keyboard_from_input_device(dev);
|
||||
if (wl_state.real_keyboard_dev)
|
||||
break;
|
||||
INPUT_LISTENER_REMOVE(wl_state.real_keyboard_key_listener);
|
||||
INPUT_LISTENER_REMOVE(wl_state.real_keyboard_modifiers_listener);
|
||||
INPUT_LISTENER_REMOVE(wl_state.real_keyboard_destroy_listener);
|
||||
|
|
@ -168,7 +166,8 @@ handle_backend_new_input(struct wl_listener *listener, void *data)
|
|||
wl_state.real_keyboard_destroy_listener.notify = handle_keyboard_destroy;
|
||||
wl_signal_add(&dev->events.destroy,
|
||||
&wl_state.real_keyboard_destroy_listener);
|
||||
wwarning("wl_backend: real keyboard wired");
|
||||
wwarning("wl_backend: real keyboard wired dev=%p xkb_state=%s", (void*)dev,
|
||||
kb->xkb_state ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case WLR_INPUT_DEVICE_POINTER: {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,10 @@ handle_keyboard_key(struct wl_listener *listener, void *data)
|
|||
return;
|
||||
|
||||
struct wlr_keyboard *kb = wl_state.seat->keyboard_state.keyboard;
|
||||
if (!kb) return;
|
||||
if (!kb) {
|
||||
wwarning("handle_keyboard_key: no seat keyboard for event keycode=%u dev=%p", event->keycode, (void*)wl_state.keyboard_dev);
|
||||
return;
|
||||
}
|
||||
|
||||
wlr_seat_keyboard_notify_modifiers(wl_state.seat, &kb->modifiers);
|
||||
|
||||
|
|
@ -81,7 +84,8 @@ handle_keyboard_key(struct wl_listener *listener, void *data)
|
|||
if (ev.u.key.utf8_len >= (int)sizeof(ev.u.key.utf8))
|
||||
ev.u.key.utf8_len = 0;
|
||||
} else {
|
||||
wwarning("handle_keyboard_key: kb->xkb_state is NULL, dropping key event (keycode=%u)", keycode);
|
||||
wwarning("handle_keyboard_key: kb->xkb_state is NULL, dropping key event (keycode=%u dev=%p seat_kb=%p)",
|
||||
keycode, (void*)wl_state.keyboard_dev, (void*)kb);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue