CnP/Wayland: Fix window check for Wayland invocations.

This was leading to never enter the cnp functions dedicated to Wayland,
as the given object was not a window. The Copy And Paste test was not
working for this reason.
This commit is contained in:
Daniel Zaoui 2014-09-08 13:51:56 +03:00
parent 24b8671f60
commit 3d85a89b2c
1 changed files with 20 additions and 16 deletions

View File

@ -3838,7 +3838,7 @@ elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection,
return _x11_elm_cnp_selection_set(xwin, obj, selection, format, selbuf, buflen); return _x11_elm_cnp_selection_set(xwin, obj, selection, format, selbuf, buflen);
#endif #endif
#ifdef HAVE_ELEMENTARY_WAYLAND #ifdef HAVE_ELEMENTARY_WAYLAND
if (elm_win_wl_window_get(obj)) if (_wl_elm_widget_window_get(obj))
return _wl_elm_cnp_selection_set(obj, selection, format, selbuf, buflen); return _wl_elm_cnp_selection_set(obj, selection, format, selbuf, buflen);
#endif #endif
return _local_elm_cnp_selection_set(obj, selection, format, selbuf, buflen); return _local_elm_cnp_selection_set(obj, selection, format, selbuf, buflen);
@ -3856,7 +3856,7 @@ elm_cnp_selection_loss_callback_set(Evas_Object *obj, Elm_Sel_Type selection,
_x11_elm_cnp_selection_loss_callback_set(obj, selection, func, data); _x11_elm_cnp_selection_loss_callback_set(obj, selection, func, data);
#endif #endif
#ifdef HAVE_ELEMENTARY_WAYLAND #ifdef HAVE_ELEMENTARY_WAYLAND
if (elm_win_wl_window_get(obj)) if (_wl_elm_widget_window_get(obj))
_wl_elm_cnp_selection_loss_callback_set(obj, selection, func, data); _wl_elm_cnp_selection_loss_callback_set(obj, selection, func, data);
#endif #endif
_local_elm_cnp_selection_loss_callback_set(obj, selection, func, data); _local_elm_cnp_selection_loss_callback_set(obj, selection, func, data);
@ -3872,7 +3872,7 @@ elm_object_cnp_selection_clear(Evas_Object *obj, Elm_Sel_Type selection)
return _x11_elm_object_cnp_selection_clear(obj, selection); return _x11_elm_object_cnp_selection_clear(obj, selection);
#endif #endif
#ifdef HAVE_ELEMENTARY_WAYLAND #ifdef HAVE_ELEMENTARY_WAYLAND
if (elm_win_wl_window_get(obj)) if (_wl_elm_widget_window_get(obj))
return _wl_elm_cnp_selection_clear(obj, selection); return _wl_elm_cnp_selection_clear(obj, selection);
#endif #endif
return _local_elm_object_cnp_selection_clear(obj, selection); return _local_elm_object_cnp_selection_clear(obj, selection);
@ -3890,7 +3890,7 @@ elm_cnp_selection_get(Evas_Object *obj, Elm_Sel_Type selection,
return _x11_elm_cnp_selection_get(xwin, obj, selection, format, datacb, udata); return _x11_elm_cnp_selection_get(xwin, obj, selection, format, datacb, udata);
#endif #endif
#ifdef HAVE_ELEMENTARY_WAYLAND #ifdef HAVE_ELEMENTARY_WAYLAND
if (elm_win_wl_window_get(obj)) if (_wl_elm_widget_window_get(obj))
return _wl_elm_cnp_selection_get(obj, selection, format, datacb, udata); return _wl_elm_cnp_selection_get(obj, selection, format, datacb, udata);
#endif #endif
return _local_elm_cnp_selection_get(obj, selection, format, datacb, udata); return _local_elm_cnp_selection_get(obj, selection, format, datacb, udata);
@ -3916,9 +3916,10 @@ elm_drop_target_add(Evas_Object *obj, Elm_Sel_Format format,
dropcb, dropdata); dropcb, dropdata);
#endif #endif
#ifdef HAVE_ELEMENTARY_WAYLAND #ifdef HAVE_ELEMENTARY_WAYLAND
return _wl_elm_drop_target_add(obj, format, entercb, enterdata, if (_wl_elm_widget_window_get(obj))
leavecb, leavedata, poscb, posdata, return _wl_elm_drop_target_add(obj, format, entercb, enterdata,
dropcb, dropdata); leavecb, leavedata, poscb, posdata,
dropcb, dropdata);
#endif #endif
return _local_elm_drop_target_add(obj, format, entercb, enterdata, return _local_elm_drop_target_add(obj, format, entercb, enterdata,
leavecb, leavedata, poscb, posdata, leavecb, leavedata, poscb, posdata,
@ -3939,8 +3940,9 @@ elm_drop_target_del(Evas_Object *obj, Elm_Sel_Format format,
leavecb, leavedata, poscb, posdata, dropcb, dropdata); leavecb, leavedata, poscb, posdata, dropcb, dropdata);
#endif #endif
#ifdef HAVE_ELEMENTARY_WAYLAND #ifdef HAVE_ELEMENTARY_WAYLAND
return _wl_elm_drop_target_del(obj, format, entercb, enterdata, if (_wl_elm_widget_window_get(obj))
leavecb, leavedata, poscb, posdata, dropcb, dropdata); return _wl_elm_drop_target_del(obj, format, entercb, enterdata,
leavecb, leavedata, poscb, posdata, dropcb, dropdata);
#endif #endif
return _local_elm_drop_target_del(obj); return _local_elm_drop_target_del(obj);
} }
@ -3963,11 +3965,12 @@ elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
dragdone, donecbdata); dragdone, donecbdata);
#endif #endif
#ifdef HAVE_ELEMENTARY_WAYLAND #ifdef HAVE_ELEMENTARY_WAYLAND
return _wl_elm_drag_start(obj, format, data, action, if (_wl_elm_widget_window_get(obj))
createicon, createdata, return _wl_elm_drag_start(obj, format, data, action,
dragpos, dragdata, createicon, createdata,
acceptcb, acceptdata, dragpos, dragdata,
dragdone, donecbdata); acceptcb, acceptdata,
dragdone, donecbdata);
#endif #endif
return _local_elm_drag_start(obj, format, data, action, return _local_elm_drag_start(obj, format, data, action,
createicon, createdata, createicon, createdata,
@ -3985,7 +3988,8 @@ elm_drag_action_set(Evas_Object *obj, Elm_Xdnd_Action action)
return _x11_elm_drag_action_set(obj, action); return _x11_elm_drag_action_set(obj, action);
#endif #endif
#ifdef HAVE_ELEMENTARY_WAYLAND #ifdef HAVE_ELEMENTARY_WAYLAND
return _wl_elm_drag_action_set(obj, action); if (_wl_elm_widget_window_get(obj))
return _wl_elm_drag_action_set(obj, action);
#endif #endif
return _local_elm_drag_action_set(obj, action); return _local_elm_drag_action_set(obj, action);
} }
@ -3999,7 +4003,7 @@ elm_selection_selection_has_owner(Evas_Object *obj)
return _x11_elm_selection_selection_has_owner(obj); return _x11_elm_selection_selection_has_owner(obj);
#endif #endif
#ifdef HAVE_ELEMENTARY_WAYLAND #ifdef HAVE_ELEMENTARY_WAYLAND
if (elm_win_wl_window_get(obj)) if (_wl_elm_widget_window_get(obj))
return ecore_wl_dnd_selection_owner_has(ecore_wl_input_get()); return ecore_wl_dnd_selection_owner_has(ecore_wl_input_get());
#endif #endif
return _local_elm_selection_selection_has_owner(obj); return _local_elm_selection_selection_has_owner(obj);