From: MinJeong Kim Date: Tue, 8 Jul 2014 13:45:47 +0000 (-0400) Subject: elm_cnp: Do not request for selection_set when buffer is empty X-Git-Tag: upstream/1.20.0~7116^2~14^2~2355 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d530cd78f600c04c0536ba0ee72e8b3bcbf4f4a;p=platform%2Fupstream%2Fefl.git elm_cnp: Do not request for selection_set when buffer is empty Summary: When a wayland client requests selection_set, Wayland server doesn't care and doesn't know how long source data is. so, it cannot ignore request for selection_set about empty buffer. therefore to avoid copying empty buffer, it need to check length of buffer before request selection_set. Test Plan: 1. Run "elementray_test -to entry5" with wayland server. 2. Drag text and try to paste. 3. Drag empty area in entry (request for selection_set on empty buffer is rejected) 4. Try to paste (you can see text of step 2). Reviewers: devilhorns, raster, seoz CC: gwanglim Differential Revision: https://phab.enlightenment.org/D1146 --- diff --git a/legacy/elementary/src/lib/elm_cnp.c b/legacy/elementary/src/lib/elm_cnp.c index fa9a662..a9028f4 100644 --- a/legacy/elementary/src/lib/elm_cnp.c +++ b/legacy/elementary/src/lib/elm_cnp.c @@ -2453,6 +2453,9 @@ _wl_elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Form if ((!selbuf) && (format != ELM_SEL_FORMAT_IMAGE)) return elm_object_cnp_selection_clear(obj, selection); + if (buflen <= 0) + return EINA_FALSE; + _wl_elm_cnp_init(); win = elm_win_wl_window_get(obj);