From 7fe38c2ec7f90ceb09204a57c18a0faba5043fa7 Mon Sep 17 00:00:00 2001 From: discomfitor Date: Sun, 24 Jul 2011 21:25:27 +0000 Subject: [PATCH] middle mouse click now changes cursor location, fixes primary selection paste location bugs git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@61656 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 1 + src/lib/edje_entry.c | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a80b05..255c357 100644 --- a/ChangeLog +++ b/ChangeLog @@ -134,3 +134,4 @@ to differentiate between paste types * Add entry,selection,all,request for signalling ctrl+a in an entry * Add entry,selection,none,request for signalling ctrl+shift+a in an entry + * Fix entry,paste,request* to be emitted after cursor,changed (fixes middle mouse paste location) diff --git a/src/lib/edje_entry.c b/src/lib/edje_entry.c index 08026e8..0d10cf6 100644 --- a/src/lib/edje_entry.c +++ b/src/lib/edje_entry.c @@ -1458,13 +1458,7 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) || (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE)) return; - if (ev->button == 2) - { - _edje_emit(rp->edje, "entry,paste,request", rp->part->name); - _edje_emit(rp->edje, "entry,paste,request,1", rp->part->name); - return; - } - if (ev->button != 1) return; + if ((ev->button != 1) && (ev->button != 2)) return; #ifdef HAVE_ECORE_IMF if (en->imf_context) @@ -1486,6 +1480,7 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS { if (en->select_allow) dosel = EINA_TRUE; } + if (ev->button == 2) dosel = EINA_FALSE; if (dosel) { // double click -> select word @@ -1604,6 +1599,11 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS #endif _edje_entry_real_part_configure(rp); + if (ev->button == 2) + { + _edje_emit(rp->edje, "entry,paste,request", rp->part->name); + _edje_emit(rp->edje, "entry,paste,request,1", rp->part->name); + } } static void -- 2.7.4