xim: Compose results of any length, StatusNone styles; ibus: no cursor size check
A Compose sequence whose result is more than one character has no keysym, so xkb_compose_state_get_one_sym gave nothing and the result was lost; the UTF-8 the compose state holds is committed instead. Clients that ask for a StatusNone style — fcitx5 offers them — failed to create an input context; the three preedit styles come in both status flavours now. IBus SetCursorLocation returned an error for a negative width or height that nothing reads and no client ever waits for.
This commit is contained in:
10
xim.c
10
xim.c
@@ -46,6 +46,9 @@ static u32int styles[] = {
|
||||
XCB_IM_PreeditPosition | XCB_IM_StatusNothing,
|
||||
XCB_IM_PreeditCallbacks | XCB_IM_StatusNothing,
|
||||
XCB_IM_PreeditNothing | XCB_IM_StatusNothing,
|
||||
XCB_IM_PreeditPosition | XCB_IM_StatusNone,
|
||||
XCB_IM_PreeditCallbacks | XCB_IM_StatusNone,
|
||||
XCB_IM_PreeditNothing | XCB_IM_StatusNone,
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -434,8 +437,8 @@ kpress(Ic *state, xcb_key_press_event_t *ev)
|
||||
;
|
||||
else if(composed){
|
||||
/* The event holds the last key of the sequence, not its result. */
|
||||
n = xkb_keysym_to_utf8(sym, buf, sizeof buf);
|
||||
commit(state, buf, max(n - 1, 0));
|
||||
n = xkb_compose_state_get_utf8(compose, buf, sizeof buf);
|
||||
commit(state, buf, min(n, (int)sizeof buf - 1));
|
||||
}else
|
||||
xcb_im_forward_event(xim, state->xic, ev);
|
||||
xcb_flush(conn);
|
||||
@@ -473,8 +476,7 @@ iccreate(xcb_im_client_t *client, xcb_im_input_context_t *ic)
|
||||
state = emalloc(sizeof(Ic));
|
||||
state->xic = ic;
|
||||
state->client = client;
|
||||
if(xcb_im_input_context_get_input_style(ic) ==
|
||||
(XCB_IM_PreeditCallbacks | XCB_IM_StatusNothing))
|
||||
if(xcb_im_input_context_get_input_style(ic) & XCB_IM_PreeditCallbacks)
|
||||
state->cap = Cclientpreedit;
|
||||
state->next = ics;
|
||||
ics = state;
|
||||
|
||||
Reference in New Issue
Block a user