# HG changeset patch # User Alex Baines # Date 1422824934 0 # Sun Feb 01 21:08:54 2015 +0000 # Node ID 396e415d9362ba7f5e59d29bb98b88c8dc095daa # Parent 64bb8e49c6a6c9437a8cece40dc32351cc2a9084 [ibus] Send an empty TextEditing event when the text is cleared by pressing backspace. diff -r 64bb8e49c6a6 -r 396e415d9362 src/core/linux/SDL_ibus.c --- a/src/core/linux/SDL_ibus.c Sat Jan 31 22:45:54 2015 +0100 +++ b/src/core/linux/SDL_ibus.c Sun Feb 01 21:08:54 2015 +0000 @@ -156,12 +156,12 @@ dbus->message_iter_init(msg, &iter); text = IBus_GetVariantText(conn, &iter, dbus); - if (text && *text) { + if (text) { char buf[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; size_t text_bytes = SDL_strlen(text), i = 0; size_t cursor = 0; - while (i < text_bytes) { + do { size_t sz = SDL_utf8strlcpy(buf, text+i, sizeof(buf)); size_t chars = IBus_utf8_strlen(buf); @@ -169,7 +169,7 @@ i += sz; cursor += chars; - } + } while (i < text_bytes); } SDL_IBus_UpdateTextRect(NULL);