static Ecore_IMF_Context *_hide_req_ctx = NULL;
static Ecore_IMF_Context *_focus_req_ctx = NULL;
static Ecore_IMF_Context *_input_panel_ctx = NULL;
+static Eina_Bool _focus_req_only = EINA_TRUE;
static Eina_Rectangle _keyboard_geometry = {0, 0, 0, 0};
static void _canvas_focus_in_cb(void *data, Evas *e, void *event_info)
{
- LOGD("ctx : %p", _focus_req_ctx);
+ LOGD("ctx : %p %d", _focus_req_ctx, _focus_req_only);
if (_focus_req_ctx) {
set_focus(_focus_req_ctx);
- show_input_panel(_focus_req_ctx);
+ if (ecore_imf_context_input_panel_enabled_get (_focus_req_ctx) || !_focus_req_only)
+ if (!ecore_imf_context_input_panel_show_on_demand_get (_focus_req_ctx) || !_focus_req_only)
+ show_input_panel (_focus_req_ctx);
WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(_focus_req_ctx);
if (imcontext && imcontext->canvas)
evas_event_callback_del(imcontext->canvas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _canvas_focus_in_cb);
_focus_req_ctx = NULL;
+ _focus_req_only = EINA_TRUE;
}
}
set_focus(ctx);
if (!imcontext->input) {
_focus_req_ctx = ctx;
+ _focus_req_only = EINA_FALSE;
if (imcontext->canvas) {
evas_event_callback_del(imcontext->canvas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _canvas_focus_in_cb);
evas_event_callback_add(imcontext->canvas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _canvas_focus_in_cb, NULL);
evas_event_callback_del(imcontext->canvas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _canvas_focus_in_cb);
_focus_req_ctx = NULL;
+ _focus_req_only = EINA_TRUE;
}
//
#endif
if (!set_focus(ctx)) {
+ WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
+ if (imcontext && !imcontext->input) {
+ if (_focus_req_ctx != ctx)
+ _focus_req_only = EINA_TRUE;
+ _focus_req_ctx = ctx;
+ if (imcontext->canvas) {
+ evas_event_callback_del(imcontext->canvas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _canvas_focus_in_cb);
+ evas_event_callback_add(imcontext->canvas, EVAS_CALLBACK_CANVAS_FOCUS_IN, _canvas_focus_in_cb, NULL);
+ }
+ }
LOGW("ctx : %p. Fail to set focus!", ctx);
return;
}
LOGD("ctx : %p", ctx);
- if (_focus_req_ctx == ctx)
+ if (_focus_req_ctx == ctx) {
_focus_req_ctx = NULL;
+ _focus_req_only = EINA_TRUE;
+ }
if (!imcontext || !imcontext->input) return;