ipc: strip machinery no peer uses; keep client state in one Keyreq

ipc.c: an AF_UNIX nonblocking connect completes at once or fails with
EAGAIN, so the EINPROGRESS/poll/SO_ERROR path and the fcntl juggling
were dead; the deadline plumbing checked a clock that cannot fail and
re-tested the deadline before every transfer although only waitfd
blocks; readfield's truncation and discard loop served the unit test,
since every caller owns char[Ipcfieldmax+1]; NULL-argument checks on
in-tree encoders are gone (peer validation stays). The primary key frame
is Ipckey, not 'legacy'; ipckeysym names the keysym mapping.

srv.c: the per-connection capability and caret already lived in the
persistent Keyreq; the mirror locals and 'negotiated' flag guarded a
protocol rule no client relied on. proccreate never fails in libthread.

gtk: focus-out no longer round-trips a reset before closing the socket
that releases the engine; the caret dedup compares the packed frame;
srvconnect's preedit no-ops and the insimple flag are gone.
This commit is contained in:
2026-08-16 15:53:08 +09:00
parent 43b469f70b
commit eb0f88f764
11 changed files with 205 additions and 394 deletions

17
main.c
View File

@@ -61,17 +61,12 @@ threadmain(int argc, char **argv)
mapinit(argv[1]);
dictinit(argv[1]);
srvinit();
if(proccreate(drawthread, nil, 16384) < 0)
die("can't create draw worker");
if(proccreate(srvthread, nil, 16384) < 0)
die("can't create server worker");
if(proccreate(ibusthread, nil, 32768) < 0)
die("can't create IBus worker");
proccreate(drawthread, nil, 16384);
proccreate(srvthread, nil, 16384);
proccreate(ibusthread, nil, 32768);
display = getenv("DISPLAY");
if(display != nil && display[0] != '\0' &&
proccreate(ximthread, nil, 32768) < 0)
die("xim: cannot create worker");
if(threadcreate(dictthread, nil, 16384) < 0)
die("can't create dictionary worker");
if(display != nil && display[0] != '\0')
proccreate(ximthread, nil, 32768);
threadcreate(dictthread, nil, 16384);
imthread(nil);
}