Set mouse level per window, instead of global.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Aleksandr Rybalko 2013-12-20 15:37:57 +00:00
parent 62f78f3261
commit d454a052df
2 changed files with 5 additions and 1 deletions

View File

@ -244,6 +244,7 @@ struct vt_window {
int vw_kbdmode; /* (?) Keyboard mode. */
char *vw_kbdsq; /* Escape sequence queue*/
unsigned int vw_flags; /* (d) Per-window flags. */
int vw_mouse_level;/* Mouse op mode. */
#define VWF_BUSY 0x1 /* Busy reconfiguring device. */
#define VWF_OPENED 0x2 /* TTY in use. */
#define VWF_SCROLL 0x4 /* Keys influence scrollback. */

View File

@ -633,6 +633,9 @@ vtterm_param(struct terminal *tm, int cmd, unsigned int arg)
case TP_SHOWCURSOR:
vtbuf_cursor_visibility(&vw->vw_buf, arg);
break;
case TP_MOUSE:
vw->vw_mouse_level = arg;
break;
}
}
@ -1206,7 +1209,7 @@ vt_mouse_event(int type, int x, int y, int event, int cnt, int mlevel)
* under mouse pointer when nothing changed.
*/
if (mlevel > 0)
if (vw->vw_mouse_level > 0)
vt_mouse_terminput(vd, type, x, y, event, cnt);
switch (type) {