}
}
-static void
+static Eina_Bool
set_focus(Ecore_IMF_Context *ctx)
{
LOGD("");
WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
- if (!imcontext) return;
+ if (!imcontext) return EINA_FALSE;
if (!imcontext->window) {
LOGW("window is not given\n");
- return;
+ return EINA_FALSE;
}
Ecore_Wl_Input *input = ecore_wl_window_keyboard_get(imcontext->window);
if (!input) {
LOGW("Can't get Wl_Input\n");
- return;
+ return EINA_FALSE;
}
struct wl_seat *seat = ecore_wl_input_seat_get(input);
if (!seat) {
LOGW("Can't get Wl_seat\n");
- return;
+ return EINA_FALSE;
}
imcontext->input = input;
wl_text_input_activate(imcontext->text_input, seat,
ecore_wl_window_surface_get(imcontext->window));
+
+ return EINA_TRUE;
}
static void
_focused_ctx = ctx;
//
- set_focus(ctx);
+ if (!set_focus(ctx)) {
+ _focused_ctx = NULL;
+ LOGW("Fail to set focus!");
+ return;
+ }
LOGD ("ctx : %p. on demand : %d\n", ctx, ecore_imf_context_input_panel_show_on_demand_get (ctx));