Skip to content

Commit

Permalink
workaround focus change while preediting
Browse files Browse the repository at this point in the history
  • Loading branch information
lilydjwg committed Dec 7, 2023
1 parent eb46e16 commit d60beee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/seat/input-method-relay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ wf::input_method_relay::input_method_relay()
auto evt_input_method = static_cast<wlr_input_method_v2*>(data);
assert(evt_input_method == input_method);

// FIXME: workaround focus change while preediting
if (focus_just_changed)
{
LOGI("focus_just_changed, ignore input method commit");
focus_just_changed = false;
return;
}

auto *text_input = find_focused_text_input();
if (text_input == nullptr)
{
Expand Down
3 changes: 3 additions & 0 deletions src/core/seat/input-method-relay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class input_method_relay
on_grab_keyboard, on_grab_keyboard_destroy, on_new_popup_surface;
wlr_input_method_keyboard_grab_v2 *keyboard_grab = nullptr;
wlr_text_input_v3 *already_disabled_input = nullptr;
bool focus_just_changed = false;
text_input *find_focusable_text_input();
void set_focus(wlr_surface*);

Expand All @@ -36,6 +37,8 @@ class input_method_relay
{
set_focus(nullptr);
}

focus_just_changed = true;
};

bool should_grab(wlr_keyboard*);
Expand Down

0 comments on commit d60beee

Please sign in to comment.