diff --git a/legacy/elementary/src/lib/elm_cnp_helper.c b/legacy/elementary/src/lib/elm_cnp_helper.c index ee9511c274..cddb58a735 100644 --- a/legacy/elementary/src/lib/elm_cnp_helper.c +++ b/legacy/elementary/src/lib/elm_cnp_helper.c @@ -389,6 +389,16 @@ static Ecore_Event_Handler *handler_status = NULL; /* Stringshared, so I can just compare pointers later */ static const char *text_uri; +Eina_Bool +elm_selection_selection_has_owner(void) +{ +#ifdef HAVE_ELEMENTARY_X + return !!ecore_x_selection_owner_get(clipboard_atom); +#else + return EINA_FALSE; +#endif +} + Eina_Bool elm_selection_set(Elm_Sel_Type selection, Evas_Object *widget, Elm_Sel_Format format, const char *selbuf) { diff --git a/legacy/elementary/src/lib/elm_entry.c b/legacy/elementary/src/lib/elm_entry.c index 851c2020fa..03bde8b5e9 100644 --- a/legacy/elementary/src/lib/elm_entry.c +++ b/legacy/elementary/src/lib/elm_entry.c @@ -1078,7 +1078,7 @@ _menu_press(Evas_Object *obj) elm_hoversel_item_add(wd->hoversel, E_("Select"), NULL, ELM_ICON_NONE, _select, obj); } - if (1) // need way to detect if someone has a selection + if (elm_selection_selection_has_owner()) { if (wd->editable) elm_hoversel_item_add(wd->hoversel, E_("Paste"), NULL, ELM_ICON_NONE, diff --git a/legacy/elementary/src/lib/elm_widget.h b/legacy/elementary/src/lib/elm_widget.h index fb9016369e..24c79362db 100644 --- a/legacy/elementary/src/lib/elm_widget.h +++ b/legacy/elementary/src/lib/elm_widget.h @@ -673,6 +673,7 @@ struct _Elm_Selection_Data Eina_Bool elm_selection_set(Elm_Sel_Type selection, Evas_Object *widget, Elm_Sel_Format format, const char *buf); Eina_Bool elm_selection_clear(Elm_Sel_Type selection, Evas_Object *widget); Eina_Bool elm_selection_get(Elm_Sel_Type selection, Elm_Sel_Format format, Evas_Object *widget, Elm_Drop_Cb datacb, void *udata); +Eina_Bool elm_selection_selection_has_owner(void); Eina_Bool elm_drop_target_add(Evas_Object *widget, Elm_Sel_Type, Elm_Drop_Cb, void *); Eina_Bool elm_drop_target_del(Evas_Object *widget); Eina_Bool elm_drag_start(Evas_Object *, Elm_Sel_Format, const char *, void (*)(void *,Evas_Object*),void*);