From 7a3ce8bc754a9cac697bcbf4e3929ad6efeda406 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Mon, 16 Aug 2010 14:52:36 +0000 Subject: [PATCH] Elementary: Fixed selection and a possible segfault. 1. Selection now works with the buttons in elementary_test. 2. Selection with ctrl+v does not print ERR:elementary elm_widget.c:1373 _elm_widget_type_check() Passing Object: (nil), of type: '(unknown)' when expecting type: 'entry' anymore. SVN revision: 51216 --- src/lib/elm_cnp_helper.c | 3 ++- src/lib/elm_entry.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/elm_cnp_helper.c b/src/lib/elm_cnp_helper.c index 43bd2f1..c439bdb 100644 --- a/src/lib/elm_cnp_helper.c +++ b/src/lib/elm_cnp_helper.c @@ -317,9 +317,9 @@ elm_selection_get(enum _elm_sel_type selection, enum _elm_sel_format format, top = elm_widget_top_get(widget); if (!top) return EINA_FALSE; - sel->request(elm_win_xwindow_get(top), "TARGETS"); sel->requestformat = format; sel->requestwidget = widget; + sel->request(elm_win_xwindow_get(top), ECORE_X_SELECTION_TARGET_UTF8_STRING); return EINA_TRUE; #else @@ -784,6 +784,7 @@ mark_up(const char *start, int *lenp){ const char *p; char *q,*ret; + if (!start) return NULL; /* First pass: Count characters */ for (l = 0, p = start ; *p ; p ++) { diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index f7af5f4..9b3c3f0 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -464,6 +464,7 @@ _paste(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) if (wd->sel_notify_handler) { #ifdef HAVE_ELEMENTARY_X + wd->selection_asked = EINA_TRUE; elm_selection_get(ELM_SEL_CLIPBOARD, ELM_SEL_MARKUP, data); #endif } @@ -1010,9 +1011,8 @@ _signal_entry_paste_request(void *data, Evas_Object *obj __UNUSED__, const char top = elm_widget_top_get(data); if ((top) && (elm_win_xwindow_get(top))) { - ecore_x_selection_primary_request(elm_win_xwindow_get(top), - ECORE_X_SELECTION_TARGET_UTF8_STRING); - wd->selection_asked = EINA_TRUE; + wd->selection_asked = EINA_TRUE; + elm_selection_get(ELM_SEL_CLIPBOARD, ELM_SEL_MARKUP, data); } #endif } -- 2.7.4