Skip to content

Commit

Permalink
don't wlr_seat_set_keyboard if keys are going to the input method.
Browse files Browse the repository at this point in the history
Or we'll alternate between two keyboards, sending a lot of keymap and
repeat_info events to all clients.
  • Loading branch information
lilydjwg committed Jan 25, 2024
1 parent 6bd1179 commit 8f1e954
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/core/seat/keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ void wf::keyboard_t::setup_listeners()
return;
}

seat->priv->set_keyboard(this);
auto is_im_sent = wf::get_core_impl().im_relay->is_im_sent(handle);
if (!is_im_sent)
{
seat->priv->set_keyboard(this);
}

if ((is_im_sent || !handle_keyboard_key(ev->keycode, ev->state)) &&
(mode == input_event_processing_mode_t::FULL))
{
Expand Down Expand Up @@ -80,7 +84,11 @@ void wf::keyboard_t::setup_listeners()

if (!wf::get_core_impl().im_relay->handle_modifier(kbd))
{
wlr_seat_set_keyboard(seat, kbd);
if (!wf::get_core_impl().im_relay->is_im_sent(handle))
{
wlr_seat_set_keyboard(seat, kbd);
}

wlr_seat_keyboard_send_modifiers(seat, &kbd->modifiers);
}

Expand Down

0 comments on commit 8f1e954

Please sign in to comment.