G_DEFINE_TYPE (BusInputContext, bus_input_context, IBUS_TYPE_SERVICE)
-/* TRUE if we can send preedit text to client. FALSE if the panel has to handle it. */
+/* TRUE if we can send preedit text to client. FALSE if the panel has to handle it. Note that we check IBUS_CAP_FOCUS here since
+ * when the capability is not set, the client has to handle a preedit text regardless of the embed_preedit_text config. */
#define PREEDIT_CONDITION \
((context->capabilities & IBUS_CAP_PREEDIT_TEXT) && \
(bus_ibus_impl_is_embed_preedit_text (BUS_DEFAULT_IBUS) || (context->capabilities & IBUS_CAP_FOCUS) == 0))
{
g_assert (BUS_IS_INPUT_CONTEXT (context));
+ /* If the context does not support IBUS_CAP_FOCUS, then the client application have to handle all information such as
+ * preedit and auxiliary text. */
+ if ((capabilities & IBUS_CAP_FOCUS) == 0) {
+ capabilities |= (IBUS_CAP_PREEDIT_TEXT | IBUS_CAP_AUXILIARY_TEXT | IBUS_CAP_LOOKUP_TABLE | IBUS_CAP_PROPERTY);
+ }
+
if (context->capabilities != capabilities) {
context->capabilities = capabilities;
* @capabilities: Capabilities flags of IBusEngine, see #IBusCapabilite
*
* Set the capabilities flags of client application.
+ * When IBUS_CAP_FOCUS is not set, IBUS_CAP_PREEDIT_TEXT, IBUS_CAP_AUXILIARY_TEXT, IBUS_CAP_LOOKUP_TABLE, and IBUS_CAP_PROPERTY have to be all set.
+ * The panel component does nothing for an application that doesn't support focus.
*
* @see_also: #IBusEngine::set-capabilities
*/