E_Input_Panel *g_input_panel = NULL;
Eina_List *handlers = NULL;
+static Eina_Bool panel_show_need_rerun = EINA_FALSE;
+
+static void
+_e_input_panel_surface_append(E_Input_Panel *input_panel, E_Input_Panel_Surface *ips)
+{
+ if (!input_panel || !ips) return;
+
+ input_panel->surfaces = eina_list_append(input_panel->surfaces, ips);
+
+ /* When a new input panel surface is created and if we have failed
+ * showing input panel previously, try to show it again here */
+ if (input_panel->surfaces && panel_show_need_rerun)
+ e_input_panel_visibility_change(EINA_TRUE);
+}
static void
_e_input_panel_surface_cb_toplevel_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *output_resource EINA_UNUSED, uint32_t position EINA_UNUSED)
if (!(input_panel = ips->input_panel)) return;
- input_panel->surfaces = eina_list_append(input_panel->surfaces, ips);
+ _e_input_panel_surface_append(input_panel, ips);
ips->panel = EINA_FALSE;
}
if (!(input_panel = ips->input_panel)) return;
- input_panel->surfaces = eina_list_append(input_panel->surfaces, ips);
+ _e_input_panel_surface_append(input_panel, ips);
ips->panel = EINA_TRUE;
}
if ((ips->showing) && (e_pixmap_usable_get(ec->pixmap)))
{
+ /* Now we can assure that previous SHOW request actually succeeded,
+ * no need for trying re-run panel show command */
+ if (panel_show_need_rerun)
+ e_input_panel_show_need_rerun_set(EINA_FALSE);
#ifdef _TV
_e_input_panel_position_set(ec, ec->client.w, ec->client.h);
ec->visible = EINA_TRUE;
ips->ec = ec;
ips->input_panel = input_panel;
- input_panel->surfaces = eina_list_append(input_panel->surfaces, ips);
+ _e_input_panel_surface_append(input_panel, ips);
wl_resource_set_implementation(cdata->shell.surface,
&_e_input_panel_surface_implementation,
E_Input_Panel_Surface *ips;
Eina_List *l;
+ /* Here, if we are trying to show input panel, we can't guarantee our SHOW request
+ * will succeed or not at this point (input panel may not have created its surface)
+ * so set panel_show_need_rerun to TRUE to try showing it again afterwards */
+ e_input_panel_show_need_rerun_set(visible);
+
if (!g_input_panel) return;
EINA_LIST_FOREACH(g_input_panel->surfaces, l, ips)
EC_CHANGED(child);
}
}
+
+void
+e_input_panel_show_need_rerun_set(Eina_Bool need_rerun)
+{
+ panel_show_need_rerun = need_rerun;
+}