fix(engine): a reset or a lost focus commits the pending text
Clicking elsewhere, changing focus, or any client reset dropped the composition in the GTK module and IBus (only XIM ResetIC handed it back), so typing 안녕 and clicking Send lost 녕. The engine now returns the pending text — a moved-to candidate first, as Enter would — on Keyreset and Keyrelease; the GTK module asks for it before closing on focus-out and commits it, IBus commits it on FocusOut, Reset and a switch to a password field, and XIM commits it on focus loss and hands it back on ResetIC without a separate capability probe.
This commit is contained in:
@@ -135,11 +135,12 @@ expectresponse(int fd, int want, int eaten, char *commit, char *preedit,
|
||||
}
|
||||
|
||||
static int
|
||||
requestreset(int fd, int want, int eaten, char *preedit, char *where)
|
||||
requestreset(int fd, int want, int eaten, char *commit, char *preedit,
|
||||
char *where)
|
||||
{
|
||||
if(!sendreset(fd, want))
|
||||
return fail("send %s: %s", where, strerror(errno));
|
||||
return expectresponse(fd, want, eaten, "", preedit, where);
|
||||
return expectresponse(fd, want, eaten, commit, preedit, where);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -257,7 +258,7 @@ runsmoke(char *path)
|
||||
requestkey(client, 1, Mctrl, 'n', 1, "", "",
|
||||
"select Japanese") &&
|
||||
requestkey(client, 1, 0, 'k', 1, "", "k", "preedit") &&
|
||||
requestreset(client, 1, 1, "", "reset");
|
||||
requestreset(client, 1, 1, "k", "", "reset");
|
||||
close(client);
|
||||
return ok;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user