add preedit to ipc

This commit is contained in:
2026-05-28 17:28:42 +09:00
parent 3a203766d5
commit ef749ba730
3 changed files with 9 additions and 0 deletions

1
dat.h
View File

@@ -128,6 +128,7 @@ struct Keyreq
int fd; int fd;
u32int ks; u32int ks;
u32int mod; u32int mod;
int want; /* nonzero: append preedit after commit */
}; };
typedef struct Dictreq Dictreq; typedef struct Dictreq Dictreq;

1
srv.c
View File

@@ -11,6 +11,7 @@ sendkey(int fd, u32int ks, u32int mod)
kr.fd = fd; kr.fd = fd;
kr.ks = ks; kr.ks = ks;
kr.mod = mod; kr.mod = mod;
kr.want = 0;
chansend(keyc, &kr); chansend(keyc, &kr);
} }

View File

@@ -312,6 +312,13 @@ imthread(void*)
out[1] = len; out[1] = len;
n += len; n += len;
} }
if(kr.want){
len = im.pre.n > 0 ?
stoutf(&im.pre, (char*)(out+n+1),
sizeof(out)-n-1) : 0;
out[n] = len;
n += 1 + len;
}
write(kr.fd, out, n); write(kr.fd, out, n);
break; break;
case 1: case 1: