forked from enlightenment/terminology
terminology: Don't paste when in mouse mode
Fixes double pasting in vi. But there seems to be a selection problem in terminology as it isn't possible to paste in vi when selecting from terminology. SVN revision: 77368
This commit is contained in:
parent
22fba090a0
commit
31e6db4883
|
@ -1227,15 +1227,16 @@ _sel_word_to(Evas_Object *obj, int cx, int cy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static Eina_Bool
|
||||||
_rep_mouse_down(Evas_Object *obj, Evas_Event_Mouse_Down *ev, int cx, int cy)
|
_rep_mouse_down(Evas_Object *obj, Evas_Event_Mouse_Down *ev, int cx, int cy)
|
||||||
{
|
{
|
||||||
Termio *sd;
|
Termio *sd;
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
Eina_Bool ret = EINA_FALSE;
|
||||||
|
|
||||||
sd = evas_object_smart_data_get(obj);
|
sd = evas_object_smart_data_get(obj);
|
||||||
if (!sd) return;
|
if (!sd) return EINA_FALSE;
|
||||||
if (sd->pty->mouse_rep == MOUSE_OFF) return;
|
if (sd->pty->mouse_rep == MOUSE_OFF) return EINA_FALSE;
|
||||||
switch (sd->pty->mouse_rep)
|
switch (sd->pty->mouse_rep)
|
||||||
{
|
{
|
||||||
case MOUSE_X10:
|
case MOUSE_X10:
|
||||||
|
@ -1253,6 +1254,7 @@ _rep_mouse_down(Evas_Object *obj, Evas_Event_Mouse_Down *ev, int cx, int cy)
|
||||||
buf[5] = cy + 1 + ' ';
|
buf[5] = cy + 1 + ' ';
|
||||||
buf[6] = 0;
|
buf[6] = 0;
|
||||||
termpty_write(sd->pty, buf, strlen(buf));
|
termpty_write(sd->pty, buf, strlen(buf));
|
||||||
|
ret = EINA_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1287,6 +1289,7 @@ _rep_mouse_down(Evas_Object *obj, Evas_Event_Mouse_Down *ev, int cx, int cy)
|
||||||
}
|
}
|
||||||
buf[i] = 0;
|
buf[i] = 0;
|
||||||
termpty_write(sd->pty, buf, strlen(buf));
|
termpty_write(sd->pty, buf, strlen(buf));
|
||||||
|
ret = EINA_TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MOUSE_SGR: // ESC.[.<.NUM.;.NUM.;.NUM.M
|
case MOUSE_SGR: // ESC.[.<.NUM.;.NUM.;.NUM.M
|
||||||
|
@ -1300,6 +1303,7 @@ _rep_mouse_down(Evas_Object *obj, Evas_Event_Mouse_Down *ev, int cx, int cy)
|
||||||
snprintf(buf, sizeof(buf), "%c[<%i;%i;%iM", 0x1b,
|
snprintf(buf, sizeof(buf), "%c[<%i;%i;%iM", 0x1b,
|
||||||
(btn | shift | meta | ctrl | dbl), cx + 1, cy + 1);
|
(btn | shift | meta | ctrl | dbl), cx + 1, cy + 1);
|
||||||
termpty_write(sd->pty, buf, strlen(buf));
|
termpty_write(sd->pty, buf, strlen(buf));
|
||||||
|
ret = EINA_TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MOUSE_NORMAL:
|
case MOUSE_NORMAL:
|
||||||
|
@ -1321,11 +1325,13 @@ _rep_mouse_down(Evas_Object *obj, Evas_Event_Mouse_Down *ev, int cx, int cy)
|
||||||
buf[5] = cy + 1 + ' ';
|
buf[5] = cy + 1 + ' ';
|
||||||
buf[6] = 0;
|
buf[6] = 0;
|
||||||
termpty_write(sd->pty, buf, strlen(buf));
|
termpty_write(sd->pty, buf, strlen(buf));
|
||||||
|
ret = EINA_TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1532,13 +1538,14 @@ static void
|
||||||
_smart_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event)
|
_smart_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event)
|
||||||
{
|
{
|
||||||
Evas_Event_Mouse_Down *ev = event;
|
Evas_Event_Mouse_Down *ev = event;
|
||||||
|
Eina_Bool paste;
|
||||||
Termio *sd;
|
Termio *sd;
|
||||||
int cx, cy;
|
int cx, cy;
|
||||||
|
|
||||||
sd = evas_object_smart_data_get(data);
|
sd = evas_object_smart_data_get(data);
|
||||||
if (!sd) return;
|
if (!sd) return;
|
||||||
_smart_xy_to_cursor(data, ev->canvas.x, ev->canvas.y, &cx, &cy);
|
_smart_xy_to_cursor(data, ev->canvas.x, ev->canvas.y, &cx, &cy);
|
||||||
_rep_mouse_down(data, ev, cx, cy);
|
paste = _rep_mouse_down(data, ev, cx, cy);
|
||||||
sd->didclick = EINA_FALSE;
|
sd->didclick = EINA_FALSE;
|
||||||
if (ev->button == 1)
|
if (ev->button == 1)
|
||||||
{
|
{
|
||||||
|
@ -1608,7 +1615,10 @@ _smart_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__
|
||||||
_smart_update_queue(data, sd);
|
_smart_update_queue(data, sd);
|
||||||
}
|
}
|
||||||
else if (ev->button == 2)
|
else if (ev->button == 2)
|
||||||
|
{
|
||||||
|
if (!paste)
|
||||||
_paste_selection(data, ELM_SEL_TYPE_PRIMARY);
|
_paste_selection(data, ELM_SEL_TYPE_PRIMARY);
|
||||||
|
}
|
||||||
else if (ev->button == 3)
|
else if (ev->button == 3)
|
||||||
evas_object_smart_callback_call(data, "options", NULL);
|
evas_object_smart_callback_call(data, "options", NULL);
|
||||||
}
|
}
|
||||||
|
@ -2338,7 +2348,7 @@ Evas_Object *
|
||||||
termio_theme_get(Evas_Object *obj)
|
termio_theme_get(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Termio *sd = evas_object_smart_data_get(obj);
|
Termio *sd = evas_object_smart_data_get(obj);
|
||||||
if (!sd) return;
|
if (!sd) return NULL;
|
||||||
|
|
||||||
return sd->theme;
|
return sd->theme;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue