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 dcc5db1908
commit a58b8adefe
2 changed files with 6 additions and 2 deletions

View file

@ -3074,11 +3074,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);
}