Re: vt newcons 3 clicks mouse paste issue FIXED
- Reply: Hans Petter Selasky : "Re: vt newcons 3 clicks mouse paste issue FIXED"
- In reply to: Ivan Quitschal : "vt newcons 3 clicks mouse paste issue FIXED"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 03 Aug 2022 17:37:09 UTC
On Tue, 2 Aug 2022, Ivan Quitschal wrote: > > Hi guys > > Currently , if you click 3 times in order to select the entire row, its just > not working as it should. > i fixed that please find below and attached the patches > > With this change now we can do a 3 clicks and paste , i dont know, in some > command, and it will be executed just fine, like it was in syscons, and still > is in xterm/ linux etc > > now if the event is a 3 mouse clickss select, the space trim is made on the > right and an <enter> is included > > thanks > > --tzk > > > -------------------- > --- sys/dev/vt/vt_buf.c.orig 2022-08-02 08:44:27.229782000 -0300 > +++ sys/dev/vt/vt_buf.c 2022-08-02 08:45:02.703697000 -0300 > @@ -771,7 +771,7 @@ > } > > void > -vtbuf_extract_marked(struct vt_buf *vb, term_char_t *buf, int sz) > +vtbuf_extract_marked(struct vt_buf *vb, term_char_t *buf, int sz, int mark) > { > int i, j, r, c, cs, ce; > term_pos_t s, e; > @@ -799,7 +799,7 @@ > buf[i++] = vb->vb_rows[r][c]; > > /* For all rows, but the last one. */ > - if (r != e.tp_row) { > + if (r != e.tp_row || mark == VTB_MARK_ROW) { > /* Trim trailing word separators, if any. */ > for (; i != j; i--) { > if (!tchar_is_word_separator(buf[i - 1])) > -------------------- > > --- sys/dev/vt/vt_core.c.orig 2022-08-02 08:43:15.436415000 -0300 > +++ sys/dev/vt/vt_core.c 2022-08-02 08:43:49.120096000 -0300 > @@ -2287,7 +2287,7 @@ > VD_PASTEBUFSZ(vd) = len; > } > /* Request copy/paste buffer data, no more than `len' */ > - vtbuf_extract_marked(&vw->vw_buf, VD_PASTEBUF(vd), len); > + vtbuf_extract_marked(&vw->vw_buf, VD_PASTEBUF(vd), len, > mark); > > VD_PASTEBUFLEN(vd) = len; > > --------------------- > > --- sys/dev/vt/vt.h.orig 2022-08-02 08:41:23.888584000 -0300 > +++ sys/dev/vt/vt.h 2022-08-02 08:41:54.504309000 -0300 > @@ -238,7 +238,7 @@ > #ifndef SC_NO_CUTPASTE > int vtbuf_set_mark(struct vt_buf *vb, int type, int col, int row); > int vtbuf_get_marked_len(struct vt_buf *vb); > -void vtbuf_extract_marked(struct vt_buf *vb, term_char_t *buf, int sz); > +void vtbuf_extract_marked(struct vt_buf *vb, term_char_t *buf, int sz, int > mark); > #endif > > #define VTB_MARK_NONE 0 > -------------------------- > hi All this is the solution i found to fix the PASTE MARK issue. today when you select and paste something , the highlight mark stays on screen forever, until you do a mouse 1 button click. this is the way i found to correct that. with this change the highlight mark disappears after you right click to paste. in mouse event, for either case VT_MOUSE_PASTEBUTTON: or case VT_MOUSE_EXTENDBUTTON: i just set "mark" to VTB_MARK_START (i dont use this EXTENDBUTTON feature i didnt find a better way to do that tho, in case any commiter wants to apply that too personally this problem is being bugging me for quite some time now. im sure im not the only one. thanks --tzk PS: below patch includes the previous change on this email chain as well --- sys/dev/vt/vt_core.c.orig 2022-08-02 08:43:15.436415000 -0300 +++ sys/dev/vt/vt_core.c 2022-08-03 12:18:40.216670000 -0300 @@ -2228,23 +2228,28 @@ case 0: /* up */ break; default: + mark = VTB_MARK_START; vt_mouse_paste(); break; } - return; /* Done */ +// return; /* Done */ + case VT_MOUSE_EXTENDBUTTON: switch (cnt) { - case 0: /* up */ + case 0: if (!(vd->vd_mstate & MOUSE_BUTTON1DOWN)) - mark = VTB_MARK_EXTEND; + mark = VTB_MARK_START; +// mark = VTB_MARK_EXTEND; else mark = 0; break; default: - mark = VTB_MARK_EXTEND; +// mark = VTB_MARK_EXTEND; + mark = VTB_MARK_START; break; } break; + default: return; /* Done */ } @@ -2287,7 +2292,7 @@ VD_PASTEBUFSZ(vd) = len; } /* Request copy/paste buffer data, no more than `len' */ - vtbuf_extract_marked(&vw->vw_buf, VD_PASTEBUF(vd), len); + vtbuf_extract_marked(&vw->vw_buf, VD_PASTEBUF(vd), len, mark); VD_PASTEBUFLEN(vd) = len;