fix(ipc): preserve legacy preedit and bound client waits

This commit is contained in:
2026-08-14 22:17:59 +09:00
parent 5dc2530951
commit 534ddcd9bb
6 changed files with 309 additions and 29 deletions

8
srv.c
View File

@@ -60,7 +60,7 @@ clientthread(void *arg)
Caret caret;
uchar out[Ipcmaxresp];
char commit[Maxutf], preedit[Maxutf];
int cap, n, ncommit, npreedit, type, want;
int cap, n, ncommit, negotiated, npreedit, type, want;
uchar token;
fd = (int)(uintptr)arg;
@@ -69,11 +69,15 @@ clientthread(void *arg)
kr.reply = reply;
kr.owner = &fd;
cap = Cclientpreedit;
negotiated = 0;
memset(&caret, 0, sizeof caret);
kr.cap = cap;
kr.caret = caret;
while((type = srvreadreq(fd, &kr, &want)) >= 0){
if(type == Ipccap)
if(type == Ipccap){
cap = want ? Cclientpreedit : 0;
negotiated = 1;
}else if(type == Ipclegacy && !negotiated)
cap = want ? Cclientpreedit : 0;
else if(type == Ipccaret)
caret = kr.caret;