mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-02-17 20:34:28 +01:00
Fixed bug 5397 - Fcitx input is truncated
sowfelicity Split the long text input event into multiple shorten text input event.
This commit is contained in:
parent
8795ca7067
commit
bfffa275ef
@ -144,8 +144,17 @@ DBus_MessageFilter(DBusConnection *conn, DBusMessage *msg, void *data)
|
|||||||
dbus->message_iter_init(msg, &iter);
|
dbus->message_iter_init(msg, &iter);
|
||||||
dbus->message_iter_get_basic(&iter, &text);
|
dbus->message_iter_get_basic(&iter, &text);
|
||||||
|
|
||||||
if (text)
|
if (text && *text) {
|
||||||
SDL_SendKeyboardText(text);
|
char buf[SDL_TEXTINPUTEVENT_TEXT_SIZE];
|
||||||
|
size_t text_bytes = SDL_strlen(text), i = 0;
|
||||||
|
|
||||||
|
while (i < text_bytes) {
|
||||||
|
size_t sz = SDL_utf8strlcpy(buf, text+i, sizeof(buf));
|
||||||
|
SDL_SendKeyboardText(buf);
|
||||||
|
|
||||||
|
i += sz;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return DBUS_HANDLER_RESULT_HANDLED;
|
return DBUS_HANDLER_RESULT_HANDLED;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user