From 3dc28c3fbbf9b0d95c2b40b8bd6d2275e709333f Mon Sep 17 00:00:00 2001 From: Brett Nash Date: Tue, 22 Jun 2010 05:12:08 +0000 Subject: [PATCH] Add me to authors, and make selection work a bit better. SVN revision: 49792 --- AUTHORS | 1 + src/lib/elm_cnp_helper.c | 2 +- src/lib/elm_entry.c | 33 +++++++++------------------------ 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/AUTHORS b/AUTHORS index 8df9a5c..8aec86f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,3 +13,4 @@ Brian Wang Mike Blumenkrantz (zmike) Saumsung Electronics Samsung SAIT +Brett Nash diff --git a/src/lib/elm_cnp_helper.c b/src/lib/elm_cnp_helper.c index af8927b..220b793 100644 --- a/src/lib/elm_cnp_helper.c +++ b/src/lib/elm_cnp_helper.c @@ -138,7 +138,7 @@ elm_selection_set(enum _elm_sel_type selection, Evas_Object *widget, sel->active = 1; sel->widget = widget; sel->set(elm_win_xwindow_get(elm_widget_top_get(widget)), - &selection, sizeof(void *)); + &selection, sizeof(int)); sel->format = format; sel->selbuf = strdup(selbuf); return true; diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 51c293c..cdcf3cf 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -925,23 +925,17 @@ _signal_selection_start(void *data, Evas_Object *obj __UNUSED__, const char *emi } wd->have_selection = EINA_TRUE; evas_object_smart_callback_call(data, SIG_SELECTION_START, NULL); +#ifdef HAVE_ELEMENTARY_X if (wd->sel_notify_handler) { - char *txt = _mkup_to_text(elm_entry_selection_get(data)); - - if (txt) - { -#ifdef HAVE_ELEMENTARY_X - Evas_Object *top; + char *txt = elm_entry_selection_get(data); + Evas_Object *top; - top = elm_widget_top_get(data); - if ((top) && (elm_win_xwindow_get(top))) - ecore_x_selection_primary_set(elm_win_xwindow_get(top), txt, - strlen(txt)); -#endif - free(txt); - } + top = elm_widget_top_get(data); + if ((top) && (elm_win_xwindow_get(top))) + elm_selection_set(ELM_SEL_PRIMARY, data, ELM_SEL_MARKUP, txt); } +#endif } static void @@ -972,17 +966,8 @@ _signal_selection_cleared(void *data, Evas_Object *obj __UNUSED__, const char *e top = elm_widget_top_get(data); if ((top) && (elm_win_xwindow_get(top))) - { - char *t; - - t = _mkup_to_text(wd->cut_sel); - if (t) - { - ecore_x_selection_primary_set(elm_win_xwindow_get(top), - t, strlen(t)); - free(t); - } - } + elm_selection_set(ELM_SEL_PRIMARY, data, ELM_SEL_MARKUP, + wd->cut_sel); #endif eina_stringshare_del(wd->cut_sel); wd->cut_sel = NULL; -- 2.7.4