e_comp_ungrab_input(0, 1);
- if (context->kbd.keymap) xkb_map_unref(context->kbd.keymap);
- if (context->kbd.state) xkb_state_unref(context->kbd.state);
+ if (context->kbd.keymap)
+ {
+ xkb_map_unref(context->kbd.keymap);
+ context->kbd.keymap = NULL;
+ }
+
+ if (context->kbd.state)
+ {
+ xkb_state_unref(context->kbd.state);
+ context->kbd.state = NULL;
+ }
}
}
#endif
static void
_e_text_input_cb_deactivate(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *seat)
{
- g_text_input = NULL;
- g_client = NULL;
E_Text_Input *text_input = wl_resource_get_user_data(resource);
E_Input_Method *input_method = NULL;
return;
}
+ if (text_input == g_text_input)
+ {
+ g_text_input = NULL;
+ g_client = NULL;
+ }
+
/* FIXME: should get input_method object from seat. */
if (g_input_method && g_input_method->resource)
input_method = wl_resource_get_user_data(g_input_method->resource);
return;
}
- EINA_LIST_FREE(text_input->input_methods, input_method)
+ if (g_text_input == text_input)
{
- if (g_text_input == text_input)
+ if (text_input->input_panel_visibile)
{
- if (text_input->input_panel_visibile)
- {
- if (g_client)
- _input_panel_hide(g_client, resource, EINA_TRUE);
- }
-
- g_text_input = NULL;
+ if (g_client)
+ _input_panel_hide(g_client, resource, EINA_TRUE);
}
+ g_text_input = NULL;
+ g_client = NULL;
+ }
+
+ EINA_LIST_FREE(text_input->input_methods, input_method)
+ {
_e_text_input_deactivate(text_input, input_method);
}