Fixed bug 3920 - IBus not work with SDL 2.0.7
authorSam Lantinga <slouken@libsdl.org>
Tue, 13 Feb 2018 08:15:39 -0800
changeset 11870b548450528c9
parent 11869 68864895c386
child 11871 c207c3ab46ee
Fixed bug 3920 - IBus not work with SDL 2.0.7

cjacker

After updating from 2.0.5 to 2.0.7, Ibus not work anymore(fcitx still works).

Compare with 2.0.5, there are two issues in SDL_ibus.c.

1, SetupConnection always return SDL_FALSE in 2.0.7.

2, 'SetCapabilities' method should be called on 'ibus_conn'.

Patch attached.
src/core/linux/SDL_ibus.c
     1.1 --- a/src/core/linux/SDL_ibus.c	Tue Feb 13 08:13:29 2018 -0800
     1.2 +++ b/src/core/linux/SDL_ibus.c	Tue Feb 13 08:15:39 2018 -0800
     1.3 @@ -299,7 +299,7 @@
     1.4              caps |= IBUS_CAP_PREEDIT_TEXT;
     1.5          }
     1.6  
     1.7 -        SDL_DBus_CallVoidMethod(IBUS_SERVICE, input_ctx_path, IBUS_INPUT_INTERFACE, "SetCapabilities",
     1.8 +        SDL_DBus_CallVoidMethodOnConnection(ibus_conn, IBUS_SERVICE, input_ctx_path, IBUS_INPUT_INTERFACE, "SetCapabilities",
     1.9                                  DBUS_TYPE_UINT32, &caps, DBUS_TYPE_INVALID);
    1.10      }
    1.11  }
    1.12 @@ -341,6 +341,7 @@
    1.13          dbus->bus_add_match(ibus_conn, "type='signal',interface='org.freedesktop.IBus.InputContext'", NULL);
    1.14          dbus->connection_try_register_object_path(ibus_conn, input_ctx_path, &ibus_vtable, dbus, NULL);
    1.15          dbus->connection_flush(ibus_conn);
    1.16 +        result = SDL_TRUE;
    1.17      }
    1.18  
    1.19      SDL_IBus_SetFocus(SDL_GetKeyboardFocus() != NULL);