add preedit to ipc
This commit is contained in:
1
dat.h
1
dat.h
@@ -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
1
srv.c
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
7
strans.c
7
strans.c
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user