fix(frontends): restart preedit around commits
This commit is contained in:
6
ibus.c
6
ibus.c
@@ -629,6 +629,7 @@ handlekey(DBusConnection *c, DBusMessage *m, Ictx *ctx)
|
||||
dbus_uint32_t sym, code, state;
|
||||
Keyres res;
|
||||
char commit[Maxutf], preedit[Maxutf];
|
||||
int restart;
|
||||
|
||||
dbus_error_init(&err);
|
||||
if(!dbus_message_get_args(m, &err,
|
||||
@@ -645,9 +646,12 @@ handlekey(DBusConnection *c, DBusMessage *m, Ictx *ctx)
|
||||
return handlebool(c, m, 0);
|
||||
stoutf(&res.commit, commit, sizeof commit);
|
||||
stoutf(&res.preedit, preedit, sizeof preedit);
|
||||
restart = clientpreedit(ctx) && commit[0] != '\0' && preowner == ctx;
|
||||
if(restart)
|
||||
emitpreedit(ctx, "");
|
||||
if(commit[0] != '\0')
|
||||
emitcommit(c, dbus_message_get_path(m), commit);
|
||||
if(clientpreedit(ctx))
|
||||
if(clientpreedit(ctx) && (!restart || preedit[0] != '\0'))
|
||||
emitpreedit(ctx, preedit);
|
||||
return handlebool(c, m, res.eaten);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user