Skip to content

Commit

Permalink
input method: remove focus change workaround
Browse files Browse the repository at this point in the history
fcitx5 no longer commit_string on deactivating.
  • Loading branch information
lilydjwg committed Jan 24, 2024
1 parent 5452f16 commit 5b7afe3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
17 changes: 0 additions & 17 deletions src/core/seat/input-method-relay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,6 @@ 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
//
// With input method v2, we have no way to notify the input method that
// input focus has changed. The input method maintains its state, and
// will bring it to the new window, i.e. a half-finished preedit string
// from the old window will be brought to the new one. This is undesired.
//
// We ignore such commit requests so it doesn't have any affect on the
// new window. Even when the previous window isn't preediting when
// switching focus, it doesn't have any bad effect to the new window anyway.
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: 0 additions & 3 deletions src/core/seat/input-method-relay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class input_method_relay
on_input_method_new, on_input_method_commit, on_input_method_destroy,
on_grab_keyboard, on_grab_keyboard_destroy, on_new_popup_surface;
wlr_input_method_keyboard_grab_v2 *keyboard_grab = nullptr;
bool focus_just_changed = false;
text_input *find_focusable_text_input();
void set_focus(wlr_surface*);

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

focus_just_changed = true;
};

bool should_grab(wlr_keyboard*);
Expand Down

0 comments on commit 5b7afe3

Please sign in to comment.