E_INPUT_PANEL_COORDINATE_TYPE_LOGICAL,
} E_Input_Panel_Coordinate_Type;
+typedef enum
+{
+ E_INPUT_PANEL_ALIGN_TOP_LEFT,
+ E_INPUT_PANEL_ALIGN_TOP_CENTER,
+ E_INPUT_PANEL_ALIGN_TOP_RIGHT,
+ E_INPUT_PANEL_ALIGN_MIDDLE_LEFT,
+ E_INPUT_PANEL_ALIGN_MIDDLE_CENTER,
+ E_INPUT_PANEL_ALIGN_MIDDLE_RIGHT,
+ E_INPUT_PANEL_ALIGN_BOTTOM_LEFT,
+ E_INPUT_PANEL_ALIGN_BOTTOM_CENTER,
+ E_INPUT_PANEL_ALIGN_BOTTOM_RIGHT,
+} E_Input_Panel_Align;
+
struct _E_Input_Panel
{
struct wl_global *global;
Eina_Bool init_landscape_position;
int before_canvas_x;
int before_canvas_y;
+ int new_width;
+ int new_height;
+ E_Input_Panel_Align align;
struct
{
int x;
int y;
} pending_position;
+
+ struct
+ {
+ int x;
+ int y;
+ } align_position;
};
static E_Input_Panel *g_input_panel = NULL;
_e_input_panel_convert_floating_position(ec, sx, sy, &nx, &ny, E_INPUT_PANEL_COORDINATE_TYPE_LOGICAL);
}
- LOGI("nx : %d, ny : %d", nx, ny);
- e_client_util_move_without_frame(ec, nx, ny);
+ if (ec->vkbd.floating && g_floating_info->new_width > 0 && g_floating_info->new_height > 0)
+ {
+ LOGI("x : %d, y : %d, w : %d, h : %d", nx, ny, g_floating_info->new_width, g_floating_info->new_height);
+ e_client_util_move_resize_without_frame(ec, nx, ny, g_floating_info->new_width, g_floating_info->new_height);
+ g_floating_info->new_width = -1;
+ g_floating_info->new_height = -1;
+ }
+ else
+ {
+ LOGI("x : %d, y : %d", nx, ny);
+ e_client_util_move_without_frame(ec, nx, ny);
+ }
+}
+
+static void
+_e_input_panel_floating_position_align_set(E_Client *ec)
+{
+ int x, y;
+
+ if (!ec || !g_floating_info) return;
+
+ x = g_floating_info->align_position.x;
+ y = g_floating_info->align_position.y;
+
+ switch (g_floating_info->align)
+ {
+ case E_INPUT_PANEL_ALIGN_TOP_CENTER:
+ x -= (ec->w / 2);
+ break;
+ case E_INPUT_PANEL_ALIGN_TOP_RIGHT:
+ x -= ec->w;
+ break;
+ case E_INPUT_PANEL_ALIGN_MIDDLE_LEFT:
+ y -= (ec->h / 2);
+ break;
+ case E_INPUT_PANEL_ALIGN_MIDDLE_CENTER:
+ x -= (ec->w / 2);
+ y -= (ec->h / 2);
+ break;
+ case E_INPUT_PANEL_ALIGN_MIDDLE_RIGHT:
+ x -= ec->w;
+ y -= (ec->h / 2);
+ break;
+ case E_INPUT_PANEL_ALIGN_BOTTOM_LEFT:
+ y -= ec->h;
+ break;
+ case E_INPUT_PANEL_ALIGN_BOTTOM_CENTER:
+ x -= (ec->w / 2);
+ y -= ec->h;
+ break;
+ case E_INPUT_PANEL_ALIGN_BOTTOM_RIGHT:
+ x -= ec->w;
+ y -= ec->h;
+ break;
+ case E_INPUT_PANEL_ALIGN_TOP_LEFT:
+ default:
+ x = g_floating_info->align_position.x;
+ y = g_floating_info->align_position.y;
+ break;
+ }
+
+ LOGI("x : %d, y : %d, w : %d, h : %d", x, y, ec->w, ec->h);
+ e_input_panel_floating_position_set(x, y);
+
+ g_floating_info->align_position.x = -1;
+ g_floating_info->align_position.y = -1;
}
static void
LOGI("IPS::SHOW\n");
+ if (ec->vkbd.floating && g_floating_info->align_position.x >= 0 && g_floating_info->align_position.y >= 0)
+ _e_input_panel_floating_position_align_set(ec);
+
_e_input_panel_position_set(ec, ec->client.w, ec->client.h);
ec->visible = EINA_TRUE;
g_floating_info->pending_position.x = -1;
g_floating_info->pending_position.y = -1;
}
+}
+
+void e_input_panel_floating_position_align_set(int x, int y, int align)
+{
+ E_Input_Panel_Surface *floating_ips = NULL;
+ E_Input_Panel_Surface *ips = NULL;
+ Eina_List *l;
+ Eina_List *l_next;
+
+ if (g_floating_info)
+ {
+ LOGI("x : %d, y : %d, align : %d", x, y, align);
+ g_floating_info->align_position.x = x;
+ g_floating_info->align_position.y = y;
+ g_floating_info->align = (E_Input_Panel_Align)align;
+ }
+
+ EINA_LIST_FOREACH_SAFE(g_input_panel->surfaces, l, l_next, ips)
+ {
+ if (!ips || !ips->ec) continue;
+ if (ips->ec->frame && ips->ec->vkbd.floating)
+ {
+ floating_ips = ips;
+ break;
+ }
+ }
+
+ if (floating_ips && floating_ips->showing)
+ _e_input_panel_floating_position_align_set(floating_ips->ec);
+}
+
+void e_input_panel_floating_panel_move_resize(int x, int y, int w, int h)
+{
+ LOGI("x : %d, y : %d, w : %d, h : %d", x, y, w, h);
+ g_floating_info->new_width = w;
+ g_floating_info->new_height = h;
+ e_input_panel_floating_position_set(x, y);
}
\ No newline at end of file
e_input_panel_floating_drag_enabled(enabled ? EINA_TRUE : EINA_FALSE);
}
+static void
+_e_text_input_method_context_cb_move_resize_floating_panel(struct wl_client *client EINA_UNUSED, struct wl_resource *resource,
+ uint32_t x, uint32_t y, uint32_t width, uint32_t height)
+{
+ E_Text_Input *text_input = wl_resource_get_user_data(resource);
+
+ CHECK_TEXT_INPUT(resource, text_input);
+ LOGI("x : %u, y : %u, w : %u, h : %u", x, y, width, height);
+ e_input_panel_floating_panel_move_resize(x, y, width, height);
+}
+
static const struct zwp_input_method_context_v1_interface _e_text_input_method_context_implementation = {
_e_text_input_method_context_cb_destroy,
_e_text_input_method_context_cb_string_commit,
_e_text_input_method_context_cb_reshow_input_panel,
_e_text_input_method_context_cb_set_floating_panel,
_e_text_input_method_context_cb_set_floating_drag_enabled,
+ _e_text_input_method_context_cb_move_resize_floating_panel,
};
static void
E_Text_Input *text_input = wl_resource_get_user_data(resource);
CHECK_TEXT_INPUT(resource, text_input);
+ LOGI("x : %u, y : %u", x, y);
e_input_panel_floating_position_set(x, y);
}
}
}
+static void
+_e_text_input_cb_input_panel_position_align_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t x, uint32_t y, uint32_t align)
+{
+ E_Text_Input *text_input = wl_resource_get_user_data(resource);
+ E_Input_Method *input_method = NULL;
+ Eina_List *l = NULL;
+
+ CHECK_TEXT_INPUT(resource, text_input);
+ e_input_panel_floating_position_align_set(x, y, align);
+
+ EINA_LIST_FOREACH(text_input->input_methods, l, input_method)
+ {
+ if (!input_method || !input_method->context) continue;
+
+ if (input_method->context->resource)
+ zwp_input_method_context_v1_send_input_panel_position_align(input_method->context->resource, x, y, align);
+ }
+}
+
static void
_e_text_input_cb_resource_destroy(struct wl_resource *resource)
{
_e_text_input_cb_finalize_content,
_e_text_input_cb_prediction_hint_data_set,
_e_text_input_cb_input_panel_enabled_set,
- _e_text_input_cb_surrounding_text_ex_set
+ _e_text_input_cb_surrounding_text_ex_set,
+ _e_text_input_cb_input_panel_position_align_set
};
static void