opt: wrong position of fcitx5 popup in wayland mode electron app when first input

This commit is contained in:
DreamMaoMao 2025-09-29 15:06:47 +08:00
parent cf8a7516b9
commit 722b2ebefc
2 changed files with 6 additions and 2 deletions

View file

@ -490,6 +490,7 @@ static void handle_text_input_enable(struct wl_listener *listener, void *data) {
update_popups_position(relay);
send_state_to_input_method(relay);
}
wlr_text_input_v3_send_done(text_input->input);
}
static void handle_text_input_disable(struct wl_listener *listener,

View file

@ -3125,11 +3125,14 @@ void focusclient(Client *c, int lift) {
/* Change cursor surface */
motionnotify(0, NULL, 0, 0, 0, 0);
// set text input focus
// must before client_notify_enter,
// otherwise the position of text_input will be wrong.
dwl_im_relay_set_focus(dwl_input_method_relay, client_surface(c));
/* Have a client, so focus its top-level wlr_surface */
client_notify_enter(client_surface(c), wlr_seat_get_keyboard(seat));
// set text input focus
dwl_im_relay_set_focus(dwl_input_method_relay, client_surface(c));
/* Activate the new client */
client_activate_surface(client_surface(c), 1);
}