fix controls button "copy" not reflecting correct selection state

This commit is contained in:
Boris Faure 2013-12-01 16:44:53 +01:00
parent 49b08115c9
commit fd38df3108
2 changed files with 10 additions and 9 deletions

View File

@ -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)

View File

@ -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)
{