E_Input_Panel *g_input_panel = NULL;
E_Input_Panel_Floating_Info *g_floating_info = NULL;
+static Eina_Bool use_main_ec_for_position_set = EINA_FALSE;
Eina_List *handlers = NULL;
static Eina_Bool panel_show_need_rerun = EINA_FALSE;
static Ecore_Timer *g_timer_wait_update = NULL;
free(ips);
}
+static Eina_Bool
+_e_input_panel_allow_position_set(E_Client *ec, E_Client *focused_ec, const char *function)
+{
+ E_Client *f_ec = focused_ec;
+
+ if (!ec) return EINA_FALSE;
+ if (!f_ec)
+ {
+ f_ec = e_client_focused_get();
+ if (!f_ec) return EINA_FALSE;
+ }
+
+ if (ec->e.state.rot.ang.curr != f_ec->e.state.rot.ang.curr)
+ {
+ if (!use_main_ec_for_position_set)
+ {
+ LOGW("%s: focused_ec's angle(%d) is different with %d", function, f_ec->e.state.rot.ang.curr, ec->e.state.rot.ang.curr);
+ return EINA_FALSE;
+ }
+ }
+ use_main_ec_for_position_set = EINA_FALSE;
+
+ return EINA_TRUE;
+}
+
static void
_e_input_panel_init_floating_position(E_Client *ec)
{
int zx, zy, zw, zh;
if (!ec || !g_floating_info) return;
+ if (!_e_input_panel_allow_position_set(ec, NULL, __FUNCTION__)) return;
e_zone_useful_geometry_get(ec->zone, &zx, &zy, &zw, &zh);
int cur_angle;
if (!ec || !g_floating_info) return;
+ if (!_e_input_panel_allow_position_set(ec, NULL, __FUNCTION__)) return;
cur_angle = ec->e.state.rot.ang.curr;
if ((!g_floating_info->init_portrait_position && (cur_angle == 0 || cur_angle == 180)) ||
static void
_e_input_panel_position_set(E_Client *ec, int w, int h)
{
+ E_Client *focused_ec;
int nx, ny;
int zx, zy, zw, zh;
Eina_Bool is_portrait;
- if (!ec || !g_floating_info) return;
+ focused_ec = e_client_focused_get();
+
+ if (!ec || !g_floating_info || !focused_ec) return;
+
+ if (!_e_input_panel_allow_position_set(ec, focused_ec, __FUNCTION__))
+ return;
e_zone_useful_geometry_get(ec->zone, &zx, &zy, &zw, &zh);
_e_input_panel_convert_floating_position(ec, sx, sy, &nx, &ny, E_INPUT_PANEL_COORDINATE_TYPE_LOGICAL);
}
+ LOGD("focused_ec's angle=%d, ec's angle=%d, nx=%d, ny=%d", focused_ec->e.state.rot.ang.curr, ec->e.state.rot.ang.curr, nx, ny);
+
e_client_util_move_without_frame(ec, nx, ny);
}
if (ec != ips->ec)
goto end;
- if (ips->showing)
+ if (ips->showing) {
+ LOGD("ec->client.w=%d, ec->client.h=%d", ec->client.w, ec->client.h);
+ use_main_ec_for_position_set = EINA_FALSE;
_e_input_panel_position_set(ec, ec->client.w, ec->client.h);
+ use_main_ec_for_position_set = EINA_TRUE;
+ }
end:
return ECORE_CALLBACK_PASS_ON;
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+ LOGD("w=%d, h=%d", w, h);
+ use_main_ec_for_position_set = EINA_FALSE;
_e_input_panel_position_set(ec, w, h);
+ use_main_ec_for_position_set = EINA_TRUE;
}
static void
if (!g_floating_info->moving_req || !g_floating_info->mouse_pressed)
return;
+ if (!_e_input_panel_allow_position_set(ec, NULL, __FUNCTION__)) return;
+
evas_object_geometry_get(obj, &x, &y, &w, &h);
d_x = x + (ev->cur.canvas.x - g_floating_info->before_canvas_x);
void
e_input_panel_floating_position_set(int x, int y)
{
- E_Client *floating_ec = NULL;
+ E_Client *floating_ec = NULL, *focused_ec = NULL;
E_Input_Panel_Surface *ips;
Eina_List *l;
Eina_List *l_next;
}
}
- if (!floating_ec || !g_floating_info) return;
+ focused_ec = e_client_focused_get();
+
+ if (!floating_ec || !focused_ec || !g_floating_info) return;
+
+ LOGD("x=%d, y=%d", x, y);
- switch (floating_ec->e.state.rot.ang.curr)
+ switch (focused_ec->e.state.rot.ang.curr)
{
case 90:
case 270: