compose: one Compose table for the XIM and IBus frontends

An IBus client throws away a dead key its engine did not take — the GTK
module's own comment says so, and Qt does the same — so é and ü were
lost in every IBus application, while XIM composed them with a table of
its own.  That table moves to compose.c, which both frontends now use;
xim.c is the shorter for it.

A finished sequence is text, not a key: the engine is asked to hand back
what it had pending, and the composed text follows it, so the composed
character can no longer land before the syllable typed before it.
This commit is contained in:
2026-08-17 12:16:07 +09:00
parent a0e83f98c6
commit ef7fb627c6
13 changed files with 149 additions and 64 deletions

View File

@@ -19,7 +19,7 @@ DOCKER_IMAGE = strans-build
DOCKER_RUN = docker run --rm --user "$$(id -u):$$(id -g)" \
-v "$(CURDIR):/src" $(DOCKER_IMAGE)
SRCS = dict.c font.c ibus.c ipc.c ko.c main.c popup_layout.c \
SRCS = compose.c dict.c font.c ibus.c ipc.c ko.c main.c popup_layout.c \
srv.c str.c strans.c trie.c vi.c win.c xim.c
OBJS = $(SRCS:.c=.o)
@@ -29,7 +29,7 @@ $(PROG): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(PROJECT_LDLIBS) $(LDLIBS)
$(OBJS): dat.h fn.h ipc.h
ibus.o: PROJECT_CPPFLAGS += $(IBUS_CFLAGS)
compose.o ibus.o: PROJECT_CPPFLAGS += $(IBUS_CFLAGS)
font.o: PROJECT_CPPFLAGS += $(TEXT_CFLAGS)
win.o: PROJECT_CPPFLAGS += $(POPUP_CFLAGS)
xim.o: PROJECT_CPPFLAGS += $(XIM_CFLAGS)