}
}
+static Eina_Rectangle _conformant_area_backup = { 0, 0, 0, 0 };
static Eina_Bool reset_conformant_area(Ecore_IMF_Context *ctx)
{
Eina_Bool reset = EINA_FALSE;
if (ecore_imf_context_client_canvas_get(ctx) && ecore_wl_window_conformant_get(window) &&
(w != 0 || h != 0)) {
reset = EINA_TRUE;
+ _conformant_area_backup.x = x;
+ _conformant_area_backup.y = y;
+ _conformant_area_backup.w = w;
+ _conformant_area_backup.h = h;
}
}
}
return reset;
}
+static void resetore_conformant_area(Ecore_IMF_Context *ctx)
+{
+ Eina_Bool restore = EINA_FALSE;
+ Ecore_Wl_Window *window = NULL;
+
+ if (!ctx) return;
+
+ WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
+ if (imcontext) window = imcontext->window;
+
+ if (window) {
+ int x = 0, y = 0, w = 0, h = 0;
+ Eina_Bool result = ecore_wl_window_keyboard_geometry_get(window, &x, &y, &w, &h);
+
+ if (result) {
+ if (ecore_imf_context_client_canvas_get(ctx) && ecore_wl_window_conformant_get(window) &&
+ (w == 0 || h == 0)) {
+ restore = EINA_TRUE;
+ }
+ }
+ }
+ LOGD("restore %d", restore);
+ if (restore) {
+ ecore_wl_window_keyboard_geometry_set(window,
+ _conformant_area_backup.x, _conformant_area_backup.y,
+ _conformant_area_backup.w, _conformant_area_backup.h);
+
+ Ecore_Wl_Event_Conformant_Change *ev;
+ ev = calloc(1, sizeof(Ecore_Wl_Event_Conformant_Change));
+ if (ev) {
+ ev->win = ecore_wl_window_id_get(window);
+ ev->part_type = 1;
+ ev->state = 0;
+ ecore_event_add(ECORE_WL_EVENT_CONFORMANT_CHANGE, ev, NULL, NULL);
+ }
+ }
+}
+
static void
_send_will_hide_ack(WaylandIMContext *imcontext)
{
if (!imcontext || !imcontext->ctx) return;
const char *szConformantReset = "CONFORMANT_RESET";
- LOGD("Checking command : %s %s", command, szConformantReset);
+ const char *szConformantRestore = "CONFORMANT_RESTORE";
+ LOGD("Checking command : %s", command);
+
if (strncmp(command, szConformantReset, strlen(szConformantReset)) == 0) {
Ecore_Wl_Window *window = imcontext->window;
if (!window) return;
if (!reset_conformant_area(imcontext->ctx)) {
_send_will_hide_ack(imcontext);
}
+ } else if (strncmp(command, szConformantRestore, strlen(szConformantRestore)) == 0) {
+ Ecore_Wl_Window *window = imcontext->window;
+ if (!window) return;
+
+ resetore_conformant_area(imcontext->ctx);
} else {
ecore_imf_context_event_callback_call(imcontext->ctx, ECORE_IMF_CALLBACK_PRIVATE_COMMAND_SEND, (void *)command);
}