cnp: Fix copy & paste in inwin inside wayland

Scenario:
  ELM_DISPLAY=wl elementary_test -to "Window Inline"

Copy & paste some stuff between entries inside the inwins and
also in a standard window.
This commit is contained in:
Jean-Philippe Andre 2017-06-15 17:32:59 +09:00
parent e4d47ed3a5
commit a173efd0a9
2 changed files with 14 additions and 2 deletions

View File

@ -2883,10 +2883,20 @@ _wl_sel_obj_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_i
static Ecore_Wl2_Input *
_wl_default_seat_get(Ecore_Wl2_Window *win, Evas_Object *obj)
{
Eo *seat;
Eo *seat, *parent2;
// FIXME: In wayland the default seat is not named "default" but "seat-X"
// where X may be 0 or really anything else.
if (!obj) return ecore_wl2_display_input_find_by_name(ecore_wl2_window_display_get(win), "default");
seat = evas_device_get(evas_object_evas_get(obj), "default");
// FIXME (there might be a better solution):
// In case of inwin, we want to use the main wl2 window for cnp, but obj
// obj belongs to the buffer canvas, so the default seat for obj does not
// match the window win.
parent2 = elm_widget_parent2_get(elm_widget_top_get(obj));
if (parent2) obj = elm_widget_top_get(parent2) ?: parent2;
seat = evas_canvas_default_device_get(evas_object_evas_get(obj), EFL_INPUT_DEVICE_TYPE_SEAT);
EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
return ecore_wl2_display_input_find(ecore_wl2_window_display_get(win),
evas_device_seat_id_get(seat));

View File

@ -2351,6 +2351,8 @@ _entry_paste_request_signal_cb(void *data,
(data, EFL_UI_EVENT_SELECTION_PASTE, NULL);
top = elm_widget_top_get(data);
if (!elm_win_window_id_get(top))
top = elm_widget_parent2_get(top);
if ((top) && (elm_win_window_id_get(top)))
{
Elm_Sel_Format formats = ELM_SEL_FORMAT_MARKUP | ELM_SEL_FORMAT_TEXT;