#include "e.h"
#include "e_mod_main.h"
#include <input-method-server-protocol.h>
+#include <dlog.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "WL_TEXTINPUT"
typedef struct _E_Input_Panel E_Input_Panel;
typedef struct _E_Input_Panel_Surface E_Input_Panel_Surface;
{
E_Input_Panel_Surface *ips;
Eina_List *l;
+ int angle = 0;
if (!g_input_panel) return EINA_FALSE;
if (!x || !y || !w || !h) return EINA_FALSE;
EINA_LIST_FOREACH(g_input_panel->surfaces, l, ips)
{
if (!ips->ec) continue;
- if (ips->ec == ec || !ec) {
- *x = ips->ec->x;
- *y = ips->ec->y;
- *w = ips->ec->w;
- *h = ips->ec->h;
+ if (ips->ec == ec || !ec)
+ {
+ angle = ips->ec->e.state.rot.ang.next < 0 ?
+ ips->ec->e.state.rot.ang.curr :
+ ips->ec->e.state.rot.ang.next;
+
+ switch (angle)
+ {
+ case 90:
+ case 270:
+ *x = ips->ec->y;
+ *y = ips->ec->x;
+ *w = ips->ec->h;
+ *h = ips->ec->w;
+ break;
+ default:
+ *x = ips->ec->x;
+ *y = ips->ec->y;
+ *w = ips->ec->w;
+ *h = ips->ec->h;
+ break;
+ }
+
return EINA_TRUE;
}
}
static void _e_text_input_deactivate(E_Text_Input *text_input, E_Input_Method *input_method);
static Eina_Bool _e_text_input_method_create_context(struct wl_client *client, E_Input_Method *input_method, E_Text_Input *text_input);
+static void
+_e_text_input_send_input_panel_geometry(struct wl_resource *resource, int x, int y, int w, int h)
+{
+ int angle = 0;
+ char geometry[128];
+
+ if (client_surface_ec)
+ {
+ angle = client_surface_ec->e.state.rot.ang.next < 0 ?
+ client_surface_ec->e.state.rot.ang.curr :
+ client_surface_ec->e.state.rot.ang.next;
+
+ LOGD("curr : %d, next : %d, angle : %d\n", client_surface_ec->e.state.rot.ang.curr,
+ client_surface_ec->e.state.rot.ang.next, angle);
+ }
+
+ snprintf(geometry, sizeof(geometry), "%d,%d,%d,%d", x, y, w, h);
+
+ switch(angle)
+ {
+ case 90:
+ case 270:
+ vconf_set_str(VCONFKEY_ISF_IME_RECENT_LAND_GEOMETRY, geometry);
+ break;
+ default:
+ vconf_set_str(VCONFKEY_ISF_IME_RECENT_PORT_GEOMETRY, geometry);
+ break;
+ }
+
+ LOGD("angle : %d, x : %d, y : %d, w : %d, h : %d\n", angle, x, y, w, h);
+
+ wl_text_input_send_input_panel_geometry(resource, x, y, w, h);
+}
+
static Eina_Bool
_will_hide_timer_handler(void *data)
{
{
int x = 0, y = 0, w = 0, h = 0;
if (e_input_panel_client_geometry_get(NULL, &x, &y, &w, &h))
- wl_text_input_send_input_panel_geometry(text_input->resource, x, y, w, h);
+ _e_text_input_send_input_panel_geometry(text_input->resource, x, y, w, h);
wl_text_input_send_input_panel_state(text_input->resource, WL_TEXT_INPUT_INPUT_PANEL_STATE_SHOW);
}
E_Event_Client *ev;
E_Client *ec;
Eina_Bool found;
+ int x = 0, y = 0, w = 0, h = 0;
ev = (E_Event_Client *)event;
EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON);
if ((ec->w < 1) && (ec->h < 1)) return ECORE_CALLBACK_PASS_ON;
if (g_text_input && g_text_input->resource)
- wl_text_input_send_input_panel_geometry(g_text_input->resource, ec->x, ec->y, ec->w, ec->h);
+ {
+ if (e_input_panel_client_geometry_get(NULL, &x, &y, &w, &h))
+ _e_text_input_send_input_panel_geometry(g_text_input->resource, x, y, w, h);
+ }
return ECORE_CALLBACK_PASS_ON;
}