billiob pushed a commit to branch master. http://git.enlightenment.org/apps/terminology.git/commit/?id=fd38df310815a76c4e259a2704641fb5533bf84f
commit fd38df310815a76c4e259a2704641fb5533bf84f Author: Boris Faure <[email protected]> Date: Sun Dec 1 16:44:53 2013 +0100 fix controls button "copy" not reflecting correct selection state --- src/bin/controls.c | 12 +++++++----- src/bin/termio.c | 7 +++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/bin/controls.c b/src/bin/controls.c index 1b73c64..e3eb124 100644 --- a/src/bin/controls.c +++ b/src/bin/controls.c @@ -110,10 +110,10 @@ _cb_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN static void _cb_frame_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED) { - if (ct_term) + if (ct_win) { - evas_object_smart_callback_del(ct_term, "selection,on", _cb_sel_on); - evas_object_smart_callback_del(ct_term, "selection,off", _cb_sel_off); + evas_object_smart_callback_del(ct_win, "selection,on", _cb_sel_on); + evas_object_smart_callback_del(ct_win, "selection,off", _cb_sel_off); } ct_frame = NULL; } @@ -226,6 +226,8 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term, { evas_object_del(ct_frame); ct_frame = NULL; + ct_win = NULL; + ct_term = NULL; } if (!ct_frame) { @@ -290,9 +292,9 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term, evas_object_event_callback_add(ct_frame, EVAS_CALLBACK_DEL, _cb_frame_del, NULL); - evas_object_smart_callback_add(term, "selection,on", _cb_sel_on, + evas_object_smart_callback_add(win, "selection,on", _cb_sel_on, NULL); - evas_object_smart_callback_add(term, "selection,off", _cb_sel_off, + evas_object_smart_callback_add(win, "selection,off", _cb_sel_off, NULL); } if (!ct_out) diff --git a/src/bin/termio.c b/src/bin/termio.c index a05f997..99e5099 100644 --- a/src/bin/termio.c +++ b/src/bin/termio.c @@ -107,9 +107,9 @@ _sel_set(Evas_Object *obj, Eina_Bool enable) if (sd->pty->selection.is_active == enable) return; sd->pty->selection.is_active = enable; if (enable) - evas_object_smart_callback_call(obj, "selection,on", NULL); + evas_object_smart_callback_call(sd->win, "selection,on", NULL); else - evas_object_smart_callback_call(obj, "selection,off", NULL); + evas_object_smart_callback_call(sd->win, "selection,off", NULL); } static inline Eina_Bool @@ -3128,8 +3128,8 @@ _smart_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUS } else { - sd->pty->selection.is_active = EINA_FALSE; sd->moved = EINA_FALSE; + _sel_set(data, EINA_FALSE); if (!shift) { sd->pty->selection.is_box = @@ -3312,7 +3312,6 @@ _smart_cb_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUS if (sd->pty->selection.makesel) { int start_x, start_y, end_x, end_y; - _sel_set(data, EINA_TRUE); if (!sd->pty->selection.is_active) { --
