forked from enlightenment/efl
elementary: Port elementary copy/paste code to use Ecore_Wl2 library
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
7e1ca56236
commit
7519a39736
|
@ -2309,7 +2309,7 @@ _x11_elm_selection_selection_has_owner(Evas_Object *obj EINA_UNUSED)
|
|||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ELEMENTARY_WAYLAND
|
||||
#ifdef HAVE_ELEMENTARY_WL2
|
||||
typedef struct _Wl_Cnp_Selection Wl_Cnp_Selection;
|
||||
|
||||
struct _Wl_Cnp_Selection
|
||||
|
@ -2329,7 +2329,7 @@ struct _Wl_Cnp_Selection
|
|||
void *loss_data;
|
||||
|
||||
Elm_Sel_Format format;
|
||||
Ecore_Wl_Window *win;
|
||||
Ecore_Wl2_Window *win;
|
||||
Elm_Xdnd_Action action;
|
||||
|
||||
Eina_Bool active : 1;
|
||||
|
@ -2376,7 +2376,7 @@ static Dropable *_wl_dropable_find(unsigned int win);
|
|||
static void _wl_dropable_handle(Dropable *drop, Evas_Coord x, Evas_Coord y);
|
||||
static void _wl_dropable_all_clean(unsigned int win);
|
||||
static Eina_Bool _wl_drops_accept(const char *type);
|
||||
static unsigned int _wl_elm_widget_window_get(const Evas_Object *obj);
|
||||
static Ecore_Wl2_Window *_wl_elm_widget_window_get(const Evas_Object *obj);
|
||||
static Evas * _wl_evas_get_from_win(unsigned int win);
|
||||
|
||||
static void
|
||||
|
@ -2397,7 +2397,7 @@ _wl_sel_obj_del2(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_
|
|||
static Eina_Bool
|
||||
_wl_elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Format format, const void *selbuf, size_t buflen)
|
||||
{
|
||||
Ecore_Wl_Window *win;
|
||||
Ecore_Wl2_Window *win;
|
||||
Wl_Cnp_Selection *sel = &wl_cnp_selection;
|
||||
|
||||
if ((!selbuf) && (format != ELM_SEL_FORMAT_IMAGE))
|
||||
|
@ -2408,7 +2408,7 @@ _wl_elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Form
|
|||
|
||||
_wl_elm_cnp_init();
|
||||
|
||||
win = elm_win_wl_window_get(obj);
|
||||
win = _wl_elm_widget_window_get(obj);
|
||||
|
||||
if (sel->loss_cb) sel->loss_cb(sel->loss_data, selection);
|
||||
|
||||
|
@ -2465,7 +2465,7 @@ _wl_elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Form
|
|||
|
||||
if (i < 0) return EINA_FALSE;
|
||||
|
||||
ecore_wl_dnd_selection_set(ecore_wl_input_get(), types);
|
||||
ecore_wl2_dnd_selection_set(ecore_wl2_window_input_get(win), types);
|
||||
|
||||
free(sel->selbuf);
|
||||
sel->buflen = buflen;
|
||||
|
@ -2483,12 +2483,12 @@ _wl_elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Form
|
|||
static Eina_Bool
|
||||
_wl_elm_cnp_selection_get(const Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Format format, Elm_Drop_Cb datacb, void *udata)
|
||||
{
|
||||
Ecore_Wl_Window *win;
|
||||
Ecore_Wl2_Window *win;
|
||||
Wl_Cnp_Selection *sel = &wl_cnp_selection;
|
||||
|
||||
_wl_elm_cnp_init();
|
||||
|
||||
win = elm_win_wl_window_get(obj);
|
||||
win = _wl_elm_widget_window_get(obj);
|
||||
|
||||
if (sel->requestwidget)
|
||||
evas_object_event_callback_del_full(sel->requestwidget,
|
||||
|
@ -2528,7 +2528,7 @@ _wl_elm_cnp_selection_get(const Evas_Object *obj, Elm_Sel_Type selection, Elm_Se
|
|||
|
||||
if (i < 0) return EINA_FALSE;
|
||||
|
||||
ecore_wl_dnd_selection_get(ecore_wl_input_get(), *types);
|
||||
ecore_wl2_dnd_selection_get(ecore_wl2_window_input_get(win), *types);
|
||||
}
|
||||
|
||||
return EINA_TRUE;
|
||||
|
@ -2573,7 +2573,7 @@ _wl_elm_cnp_selection_clear(Evas_Object *obj, Elm_Sel_Type selection EINA_UNUSED
|
|||
ELM_SAFE_FREE(sel->selbuf, free);
|
||||
sel->buflen = 0;
|
||||
/* sel->clear(); */
|
||||
ecore_wl_dnd_selection_clear(ecore_wl_input_get());
|
||||
ecore_wl2_dnd_selection_clear(ecore_wl2_window_input_get(_wl_elm_widget_window_get(obj)));
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
@ -2585,7 +2585,7 @@ _wl_selection_send(void *udata, int type EINA_UNUSED, void *event)
|
|||
int ret, len_remained;
|
||||
int len_written = 0;
|
||||
Wl_Cnp_Selection *sel = udata;
|
||||
Ecore_Wl_Event_Data_Source_Send *ev = event;
|
||||
Ecore_Wl2_Event_Data_Source_Send *ev = event;
|
||||
|
||||
_wl_elm_cnp_init();
|
||||
|
||||
|
@ -2609,7 +2609,7 @@ static Eina_Bool
|
|||
_wl_selection_receive(void *udata, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Wl_Cnp_Selection *sel = udata;
|
||||
Ecore_Wl_Event_Selection_Data_Ready *ev = event;
|
||||
Ecore_Wl2_Event_Selection_Data_Ready *ev = event;
|
||||
|
||||
_wl_elm_cnp_init();
|
||||
|
||||
|
@ -2700,9 +2700,9 @@ _wl_elm_cnp_init(void)
|
|||
if (_init_count > 0) return EINA_TRUE;
|
||||
_init_count++;
|
||||
|
||||
ecore_event_handler_add(ECORE_WL_EVENT_DATA_SOURCE_SEND,
|
||||
ecore_event_handler_add(ECORE_WL2_EVENT_DATA_SOURCE_SEND,
|
||||
_wl_selection_send, &wl_cnp_selection);
|
||||
ecore_event_handler_add(ECORE_WL_EVENT_SELECTION_DATA_READY,
|
||||
ecore_event_handler_add(ECORE_WL2_EVENT_SELECTION_DATA_READY,
|
||||
_wl_selection_receive, &wl_cnp_selection);
|
||||
|
||||
return EINA_TRUE;
|
||||
|
@ -2718,12 +2718,12 @@ _wl_elm_dnd_init(void)
|
|||
|
||||
text_uri = eina_stringshare_add("text/uri-list");
|
||||
|
||||
ecore_event_handler_add(ECORE_WL_EVENT_DATA_SOURCE_SEND,
|
||||
ecore_event_handler_add(ECORE_WL2_EVENT_DATA_SOURCE_SEND,
|
||||
_wl_dnd_send, &wl_cnp_selection);
|
||||
ecore_event_handler_add(ECORE_WL_EVENT_SELECTION_DATA_READY,
|
||||
ecore_event_handler_add(ECORE_WL2_EVENT_SELECTION_DATA_READY,
|
||||
_wl_dnd_receive, &wl_cnp_selection);
|
||||
|
||||
ecore_event_handler_add(ECORE_WL_EVENT_DND_END,
|
||||
ecore_event_handler_add(ECORE_WL2_EVENT_DND_END,
|
||||
_wl_dnd_end, &wl_cnp_selection);
|
||||
|
||||
return EINA_TRUE;
|
||||
|
@ -2769,16 +2769,16 @@ _wl_elm_drop_target_add(Evas_Object *obj, Elm_Sel_Format format, Elm_Drag_State
|
|||
if (first)
|
||||
{
|
||||
handler_enter =
|
||||
ecore_event_handler_add(ECORE_WL_EVENT_DND_ENTER,
|
||||
ecore_event_handler_add(ECORE_WL2_EVENT_DND_ENTER,
|
||||
_wl_dnd_enter, NULL);
|
||||
handler_leave =
|
||||
ecore_event_handler_add(ECORE_WL_EVENT_DND_LEAVE,
|
||||
ecore_event_handler_add(ECORE_WL2_EVENT_DND_LEAVE,
|
||||
_wl_dnd_leave, NULL);
|
||||
handler_pos =
|
||||
ecore_event_handler_add(ECORE_WL_EVENT_DND_POSITION,
|
||||
ecore_event_handler_add(ECORE_WL2_EVENT_DND_MOTION,
|
||||
_wl_dnd_position, NULL);
|
||||
handler_drop =
|
||||
ecore_event_handler_add(ECORE_WL_EVENT_DND_DROP,
|
||||
ecore_event_handler_add(ECORE_WL2_EVENT_DND_DROP,
|
||||
_wl_dnd_drop, NULL);
|
||||
_wl_elm_dnd_init();
|
||||
}
|
||||
|
@ -2838,7 +2838,7 @@ _wl_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
|
|||
int x, y, x2 = 0, y2 = 0, x3, y3, w = 0, h = 0;
|
||||
const char *types[CNP_N_ATOMS + 1];
|
||||
int i, nb_types = 0;
|
||||
Ecore_Wl_Window *parent = NULL;
|
||||
Ecore_Wl2_Window *parent = NULL, *win;
|
||||
|
||||
_wl_elm_dnd_init();
|
||||
|
||||
|
@ -2854,7 +2854,9 @@ _wl_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
|
|||
}
|
||||
}
|
||||
types[nb_types] = NULL;
|
||||
ecore_wl_dnd_drag_types_set(ecore_wl_input_get(), types);
|
||||
|
||||
win = _wl_elm_widget_window_get(obj);
|
||||
ecore_wl2_dnd_drag_types_set(ecore_wl2_window_input_get(win), types);
|
||||
|
||||
/* set the drag data used when a drop occurs */
|
||||
free(wl_cnp_selection.selbuf);
|
||||
|
@ -2879,8 +2881,9 @@ _wl_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
|
|||
elm_win_borderless_set(dragwin, EINA_TRUE);
|
||||
elm_win_override_set(dragwin, EINA_TRUE);
|
||||
|
||||
ecore_wl_window_type_set(elm_win_wl_window_get(dragwin),
|
||||
ECORE_WL_WINDOW_TYPE_DND);
|
||||
win = elm_win_wl_window_get(dragwin);
|
||||
|
||||
ecore_wl2_window_type_set(win, ECORE_WL2_WINDOW_TYPE_DND);
|
||||
|
||||
if (createicon)
|
||||
{
|
||||
|
@ -2938,12 +2941,10 @@ _wl_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
|
|||
if (!(ee = ecore_evas_ecore_evas_get(evas)))
|
||||
return EINA_FALSE;
|
||||
|
||||
parent = ecore_evas_wayland_window_get(ee);
|
||||
parent = ecore_evas_wayland_window_get2(ee);
|
||||
}
|
||||
|
||||
ecore_wl_dnd_drag_start(ecore_wl_input_get(), parent,
|
||||
elm_win_wl_window_get(dragwin),
|
||||
x3, y3, w, h);
|
||||
ecore_wl2_dnd_drag_start(ecore_wl2_window_input_get(win), parent, win);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
@ -2958,7 +2959,7 @@ _wl_drag_source_del(void *data EINA_UNUSED, Evas *evas EINA_UNUSED, Evas_Object
|
|||
static Eina_Bool
|
||||
_wl_dnd_enter(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Wl_Event_Dnd_Enter *ev;
|
||||
Ecore_Wl2_Event_Dnd_Enter *ev;
|
||||
int i = 0;
|
||||
|
||||
ev = event;
|
||||
|
@ -2996,7 +2997,7 @@ _wl_dnd_enter(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
|||
static Eina_Bool
|
||||
_wl_dnd_leave(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Wl_Event_Dnd_Leave *ev;
|
||||
Ecore_Wl2_Event_Dnd_Leave *ev;
|
||||
Dropable *drop;
|
||||
cnp_debug("In\n");
|
||||
|
||||
|
@ -3013,16 +3014,16 @@ _wl_dnd_leave(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
|||
static Eina_Bool
|
||||
_wl_dnd_position(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Wl_Event_Dnd_Position *ev;
|
||||
Ecore_Wl2_Event_Dnd_Motion *ev;
|
||||
Dropable *drop;
|
||||
Eina_Bool will_accept = EINA_FALSE;
|
||||
|
||||
ev = event;
|
||||
|
||||
cnp_debug("mouse pos %i %i\n", ev->position.x, ev->position.y);
|
||||
cnp_debug("mouse pos %i %i\n", ev->x, ev->y);
|
||||
|
||||
dragwin_x_end = ev->position.x - _dragx;
|
||||
dragwin_y_end = ev->position.y - _dragy;
|
||||
dragwin_x_end = ev->x - _dragx;
|
||||
dragwin_y_end = ev->y - _dragy;
|
||||
|
||||
drop = _wl_dropable_find(ev->win);
|
||||
|
||||
|
@ -3030,8 +3031,8 @@ _wl_dnd_position(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
|||
{
|
||||
Evas_Coord x = 0, y = 0;
|
||||
|
||||
x = ev->position.x;
|
||||
y = ev->position.y;
|
||||
x = ev->x;
|
||||
y = ev->y;
|
||||
_dropable_coords_adjust(drop, &x, &y);
|
||||
Evas *evas = _wl_evas_get_from_win(ev->win);
|
||||
|
||||
|
@ -3113,14 +3114,15 @@ _wl_dnd_position(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
|||
static Eina_Bool
|
||||
_wl_dnd_drop(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Ecore_Wl_Event_Dnd_Drop *ev;
|
||||
Ecore_Wl2_Event_Dnd_Drop *ev;
|
||||
Ecore_Wl2_Window *win;
|
||||
Dropable *drop;
|
||||
Eina_List *l;
|
||||
|
||||
cnp_debug("In\n");
|
||||
ev = event;
|
||||
savedtypes.x = ev->position.x;
|
||||
savedtypes.y = ev->position.y;
|
||||
savedtypes.x = ev->x;
|
||||
savedtypes.y = ev->y;
|
||||
|
||||
EINA_LIST_FOREACH(drops, l, drop)
|
||||
{
|
||||
|
@ -3132,12 +3134,16 @@ _wl_dnd_drop(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
|
|||
EVAS_CALLBACK_DEL,
|
||||
_wl_sel_obj_del2,
|
||||
&wl_cnp_selection);
|
||||
ecore_wl_dnd_drag_get(ecore_wl_input_get(), drop->last.type);
|
||||
|
||||
win = _wl_elm_widget_window_get(drop->obj);
|
||||
ecore_wl2_dnd_drag_get(ecore_wl2_window_input_get(win),
|
||||
drop->last.type);
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
}
|
||||
|
||||
ecore_wl_dnd_drag_end(ecore_wl_input_get());
|
||||
win = ecore_wl2_display_window_find(_elm_wl_display, ev->win);
|
||||
ecore_wl2_dnd_drag_end(ecore_wl2_window_input_get(win));
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
|
@ -3148,7 +3154,7 @@ _wl_dnd_send(void *data, int type EINA_UNUSED, void *event)
|
|||
int ret, len_remained;
|
||||
int len_written = 0;
|
||||
Wl_Cnp_Selection *sel;
|
||||
Ecore_Wl_Event_Data_Source_Send *ev;
|
||||
Ecore_Wl2_Event_Data_Source_Send *ev;
|
||||
|
||||
cnp_debug("In\n");
|
||||
ev = event;
|
||||
|
@ -3174,7 +3180,7 @@ static Eina_Bool
|
|||
_wl_dnd_receive(void *data, int type EINA_UNUSED, void *event)
|
||||
{
|
||||
Wl_Cnp_Selection *sel;
|
||||
Ecore_Wl_Event_Selection_Data_Ready *ev;
|
||||
Ecore_Wl2_Event_Selection_Data_Ready *ev;
|
||||
cnp_debug("In\n");
|
||||
|
||||
ev = event;
|
||||
|
@ -3199,10 +3205,12 @@ _wl_dnd_receive(void *data, int type EINA_UNUSED, void *event)
|
|||
static Eina_Bool
|
||||
_wl_dnd_end(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
|
||||
{
|
||||
cnp_debug("In\n");
|
||||
/* Ecore_Wl_Event_Dnd_End *ev; */
|
||||
Ecore_Wl2_Event_Dnd_End *ev;
|
||||
Ecore_Wl2_Window *win;
|
||||
|
||||
/* ev = event; */
|
||||
cnp_debug("In\n");
|
||||
|
||||
ev = event;
|
||||
|
||||
if (dragdonecb) dragdonecb(dragdonedata, dragwidget);
|
||||
|
||||
|
@ -3229,7 +3237,8 @@ _wl_dnd_end(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSE
|
|||
dragwidget = NULL;
|
||||
doaccept = EINA_FALSE;
|
||||
|
||||
ecore_wl_input_ungrab(ecore_wl_input_get());
|
||||
win = ecore_wl2_display_window_find(_elm_wl_display, ev->win);
|
||||
ecore_wl2_input_ungrab(ecore_wl2_window_input_get(win));
|
||||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
@ -3243,17 +3252,21 @@ _wl_dropable_match(Dropable_Cbs *cbs, Dropable *drop, Elm_Sel_Format fmt)
|
|||
static void
|
||||
_wl_dropable_data_handle(Wl_Cnp_Selection *sel, char *data, size_t size)
|
||||
{
|
||||
cnp_debug("In\n");
|
||||
Dropable *drop;
|
||||
Elm_Selection_Data sdata;
|
||||
Ecore_Wl2_Window *win;
|
||||
char *s;
|
||||
|
||||
cnp_debug("In\n");
|
||||
|
||||
sdata.action = ELM_XDND_ACTION_COPY;
|
||||
|
||||
sdata.len = size;
|
||||
sdata.x = savedtypes.x;
|
||||
sdata.y = savedtypes.y;
|
||||
|
||||
win = _wl_elm_widget_window_get(sel->requestwidget);
|
||||
|
||||
eo_do(sel->requestwidget, drop = eo_key_data_get("__elm_dropable"));
|
||||
if (drop)
|
||||
{
|
||||
|
@ -3267,7 +3280,7 @@ _wl_dropable_data_handle(Wl_Cnp_Selection *sel, char *data, size_t size)
|
|||
savedtypes.textreq || _wl_dropable_match(cbs, drop, ELM_SEL_FORMAT_TEXT));
|
||||
if (!s)
|
||||
{
|
||||
ecore_wl_dnd_drag_end(ecore_wl_input_get());
|
||||
ecore_wl2_dnd_drag_end(ecore_wl2_window_input_get(win));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3287,7 +3300,8 @@ _wl_dropable_data_handle(Wl_Cnp_Selection *sel, char *data, size_t size)
|
|||
}
|
||||
}
|
||||
}
|
||||
ecore_wl_dnd_drag_end(ecore_wl_input_get());
|
||||
|
||||
ecore_wl2_dnd_drag_end(ecore_wl2_window_input_get(win));
|
||||
savedtypes.textreq = 0;
|
||||
}
|
||||
|
||||
|
@ -3296,11 +3310,17 @@ _wl_dropable_find(unsigned int win)
|
|||
{
|
||||
Eina_List *l;
|
||||
Dropable *dropable;
|
||||
Ecore_Wl2_Window *window;
|
||||
|
||||
if (!drops) return NULL;
|
||||
|
||||
window = ecore_wl2_display_window_find(_elm_wl_display, win);
|
||||
if (!window) return NULL;
|
||||
|
||||
EINA_LIST_FOREACH(drops, l, dropable)
|
||||
if (_wl_elm_widget_window_get(dropable->obj) == win)
|
||||
if (_wl_elm_widget_window_get(dropable->obj) == window)
|
||||
return dropable;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -3362,10 +3382,14 @@ _wl_dropable_all_clean(unsigned int win)
|
|||
{
|
||||
Eina_List *l;
|
||||
Dropable *dropable;
|
||||
Ecore_Wl2_Window *window;
|
||||
|
||||
window = ecore_wl2_display_window_find(_elm_wl_display, win);
|
||||
if (!window) return;
|
||||
|
||||
EINA_LIST_FOREACH(drops, l, dropable)
|
||||
{
|
||||
if (_wl_elm_widget_window_get(dropable->obj) == win)
|
||||
if (_wl_elm_widget_window_get(dropable->obj) == window)
|
||||
{
|
||||
dropable->last.x = 0;
|
||||
dropable->last.y = 0;
|
||||
|
@ -3413,11 +3437,11 @@ _wl_drops_accept(const char *type)
|
|||
return will_accept;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
static Ecore_Wl2_Window *
|
||||
_wl_elm_widget_window_get(const Evas_Object *obj)
|
||||
{
|
||||
Evas_Object *top;
|
||||
Ecore_Wl_Window *win = NULL;
|
||||
Ecore_Wl2_Window *win = NULL;
|
||||
|
||||
if (elm_widget_is(obj))
|
||||
{
|
||||
|
@ -3433,26 +3457,26 @@ _wl_elm_widget_window_get(const Evas_Object *obj)
|
|||
const char *engine_name;
|
||||
|
||||
if (!(evas = evas_object_evas_get(obj)))
|
||||
return 0;
|
||||
return NULL;
|
||||
if (!(ee = ecore_evas_ecore_evas_get(evas)))
|
||||
return 0;
|
||||
return NULL;
|
||||
|
||||
engine_name = ecore_evas_engine_name_get(ee);
|
||||
if (!strcmp(engine_name, ELM_BUFFER))
|
||||
{
|
||||
ee = ecore_evas_buffer_ecore_evas_parent_get(ee);
|
||||
if (!ee) return 0;
|
||||
win = ecore_evas_wayland_window_get(ee);
|
||||
if (!ee) return NULL;
|
||||
win = ecore_evas_wayland_window_get2(ee);
|
||||
}
|
||||
else if (!strncmp(engine_name, "wayland", sizeof("wayland") - 1))
|
||||
{
|
||||
/* In case the engine is not a buffer, we want to check once. */
|
||||
win = ecore_evas_wayland_window_get(ee);
|
||||
if (!win) return 0;
|
||||
win = ecore_evas_wayland_window_get2(ee);
|
||||
if (!win) return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return ecore_wl_window_id_get(win);
|
||||
return win;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -3832,7 +3856,7 @@ elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection,
|
|||
if (xwin)
|
||||
return _x11_elm_cnp_selection_set(xwin, obj, selection, format, selbuf, buflen);
|
||||
#endif
|
||||
#ifdef HAVE_ELEMENTARY_WAYLAND
|
||||
#ifdef HAVE_ELEMENTARY_WL2
|
||||
if (_wl_elm_widget_window_get(obj))
|
||||
return _wl_elm_cnp_selection_set(obj, selection, format, selbuf, buflen);
|
||||
#endif
|
||||
|
@ -3850,7 +3874,7 @@ elm_cnp_selection_loss_callback_set(Evas_Object *obj, Elm_Sel_Type selection,
|
|||
if (_x11_elm_widget_xwin_get(obj))
|
||||
_x11_elm_cnp_selection_loss_callback_set(obj, selection, func, data);
|
||||
#endif
|
||||
#ifdef HAVE_ELEMENTARY_WAYLAND
|
||||
#ifdef HAVE_ELEMENTARY_WL2
|
||||
if (_wl_elm_widget_window_get(obj))
|
||||
_wl_elm_cnp_selection_loss_callback_set(obj, selection, func, data);
|
||||
#endif
|
||||
|
@ -3866,7 +3890,7 @@ elm_object_cnp_selection_clear(Evas_Object *obj, Elm_Sel_Type selection)
|
|||
if (_x11_elm_widget_xwin_get(obj))
|
||||
return _x11_elm_object_cnp_selection_clear(obj, selection);
|
||||
#endif
|
||||
#ifdef HAVE_ELEMENTARY_WAYLAND
|
||||
#ifdef HAVE_ELEMENTARY_WL2
|
||||
if (_wl_elm_widget_window_get(obj))
|
||||
return _wl_elm_cnp_selection_clear(obj, selection);
|
||||
#endif
|
||||
|
@ -3884,7 +3908,7 @@ elm_cnp_selection_get(const Evas_Object *obj, Elm_Sel_Type selection,
|
|||
if (xwin)
|
||||
return _x11_elm_cnp_selection_get(xwin, obj, selection, format, datacb, udata);
|
||||
#endif
|
||||
#ifdef HAVE_ELEMENTARY_WAYLAND
|
||||
#ifdef HAVE_ELEMENTARY_WL2
|
||||
if (_wl_elm_widget_window_get(obj))
|
||||
return _wl_elm_cnp_selection_get(obj, selection, format, datacb, udata);
|
||||
#endif
|
||||
|
@ -3910,7 +3934,7 @@ elm_drop_target_add(Evas_Object *obj, Elm_Sel_Format format,
|
|||
leavecb, leavedata, poscb, posdata,
|
||||
dropcb, dropdata);
|
||||
#endif
|
||||
#ifdef HAVE_ELEMENTARY_WAYLAND
|
||||
#ifdef HAVE_ELEMENTARY_WL2
|
||||
if (_wl_elm_widget_window_get(obj))
|
||||
return _wl_elm_drop_target_add(obj, format, entercb, enterdata,
|
||||
leavecb, leavedata, poscb, posdata,
|
||||
|
@ -3934,7 +3958,7 @@ elm_drop_target_del(Evas_Object *obj, Elm_Sel_Format format,
|
|||
return _x11_elm_drop_target_del(obj, format, entercb, enterdata,
|
||||
leavecb, leavedata, poscb, posdata, dropcb, dropdata);
|
||||
#endif
|
||||
#ifdef HAVE_ELEMENTARY_WAYLAND
|
||||
#ifdef HAVE_ELEMENTARY_WL2
|
||||
if (_wl_elm_widget_window_get(obj))
|
||||
return _wl_elm_drop_target_del(obj, format, entercb, enterdata,
|
||||
leavecb, leavedata, poscb, posdata, dropcb, dropdata);
|
||||
|
@ -3967,7 +3991,7 @@ elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
|
|||
acceptcb, acceptdata,
|
||||
dragdone, donecbdata);
|
||||
#endif
|
||||
#ifdef HAVE_ELEMENTARY_WAYLAND
|
||||
#ifdef HAVE_ELEMENTARY_WL2
|
||||
if (_wl_elm_widget_window_get(obj))
|
||||
return _wl_elm_drag_start(obj, format, data, action,
|
||||
createicon, createdata,
|
||||
|
@ -3990,7 +4014,7 @@ elm_drag_action_set(Evas_Object *obj, Elm_Xdnd_Action action)
|
|||
if (_x11_elm_widget_xwin_get(obj))
|
||||
return _x11_elm_drag_action_set(obj, action);
|
||||
#endif
|
||||
#ifdef HAVE_ELEMENTARY_WAYLAND
|
||||
#ifdef HAVE_ELEMENTARY_WL2
|
||||
if (_wl_elm_widget_window_get(obj))
|
||||
return _wl_elm_drag_action_set(obj, action);
|
||||
#endif
|
||||
|
@ -4005,9 +4029,12 @@ elm_selection_selection_has_owner(Evas_Object *obj)
|
|||
if (_x11_elm_widget_xwin_get(obj))
|
||||
return _x11_elm_selection_selection_has_owner(obj);
|
||||
#endif
|
||||
#ifdef HAVE_ELEMENTARY_WAYLAND
|
||||
if (_wl_elm_widget_window_get(obj))
|
||||
return ecore_wl_dnd_selection_owner_has(ecore_wl_input_get());
|
||||
#ifdef HAVE_ELEMENTARY_WL2
|
||||
Ecore_Wl2_Window *win;
|
||||
|
||||
win = _wl_elm_widget_window_get(obj);
|
||||
if (win)
|
||||
return ecore_wl2_dnd_selection_owner_has(ecore_wl2_window_input_get(win));
|
||||
#endif
|
||||
return _local_elm_selection_selection_has_owner(obj);
|
||||
}
|
||||
|
@ -4491,9 +4518,12 @@ elm_drag_cancel(Evas_Object *obj)
|
|||
goto end;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_ELEMENTARY_WAYLAND
|
||||
if (_wl_elm_widget_window_get(obj))
|
||||
ecore_wl_dnd_drag_end(ecore_wl_input_get());
|
||||
#ifdef HAVE_ELEMENTARY_WL2
|
||||
Ecore_Wl2_Window *win;
|
||||
|
||||
win = _wl_elm_widget_window_get(obj);
|
||||
if (win)
|
||||
ecore_wl2_dnd_drag_end(ecore_wl2_window_input_get(win));
|
||||
#endif
|
||||
|
||||
end:
|
||||
|
|
Loading…
Reference in New Issue