Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Aug 2022 09:34:22 -0300 (-03)
From:      Ivan Quitschal <tezeka@hotmail.com>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        Tomoaki AOKI <junchoon@dec.sakura.ne.jp>,  Ivan Quitschal <tezeka@hotmail.com>,  "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>,  Kurt Jaeger <pi@freebsd.org>
Subject:   vt newcons 3 clicks mouse paste issue FIXED
Message-ID:  <CP6P284MB1900DD45138428B4612DF7ACCB9D9@CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM>
In-Reply-To: <fd0f9de9-98ac-87b4-2c9d-5fdc27bdb3c4@selasky.org>
References:  <CP6P284MB1900CA1ED5B5BADE054ECB34CBB29@CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM> <f6c1ee1c-bdd9-c8d6-1385-145022e6765d@selasky.org> <CP6P284MB1900CC7B7F6343DAB1D1E5BCCBB29@CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM> <41ef5c38-515f-739a-cb47-7cab0e609526@selasky.org> <CP6P284MB1900DD3D6F41CBAF38CF2CA4CBB29@CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM> <20220623014847.067b18a5ba388639cf6009ce@dec.sakura.ne.jp> <fd0f9de9-98ac-87b4-2c9d-5fdc27bdb3c4@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--3432851520-1375550816-1659443668=:1751
Content-Type: text/plain; format=flowed; charset=US-ASCII


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

--3432851520-1375550816-1659443668=:1751
Content-Type: text/plain; charset=US-ASCII; name=vt.h.diff
Content-Transfer-Encoding: BASE64
Content-ID: <bc217e9f-191-c752-380-2571d19c6a2@hotmail.com>
Content-Description:
Content-Disposition: attachment; filename=vt.h.diff

LS0tIHN5cy9kZXYvdnQvdnQuaC5vcmlnCTIwMjItMDgtMDIgMDg6NDE6MjMuODg4NTg0MDAwIC0w
MzAwDQorKysgc3lzL2Rldi92dC92dC5oCTIwMjItMDgtMDIgMDg6NDE6NTQuNTA0MzA5MDAwIC0w
MzAwDQpAQCAtMjM4LDcgKzIzOCw3IEBADQogI2lmbmRlZiBTQ19OT19DVVRQQVNURQ0KIGludCB2
dGJ1Zl9zZXRfbWFyayhzdHJ1Y3QgdnRfYnVmICp2YiwgaW50IHR5cGUsIGludCBjb2wsIGludCBy
b3cpOw0KIGludCB2dGJ1Zl9nZXRfbWFya2VkX2xlbihzdHJ1Y3QgdnRfYnVmICp2Yik7DQotdm9p
ZCB2dGJ1Zl9leHRyYWN0X21hcmtlZChzdHJ1Y3QgdnRfYnVmICp2YiwgdGVybV9jaGFyX3QgKmJ1
ZiwgaW50IHN6KTsNCit2b2lkIHZ0YnVmX2V4dHJhY3RfbWFya2VkKHN0cnVjdCB2dF9idWYgKnZi
LCB0ZXJtX2NoYXJfdCAqYnVmLCBpbnQgc3osIGludCBtYXJrKTsNCiAjZW5kaWYNCiANCiAjZGVm
aW5lCVZUQl9NQVJLX05PTkUJCTANCg==

--3432851520-1375550816-1659443668=:1751
Content-Type: text/plain; charset=US-ASCII; name=vt_buf.diff
Content-Transfer-Encoding: BASE64
Content-ID: <d3d95be6-b04c-da51-5fed-1b9e8dc83c4@hotmail.com>
Content-Description:
Content-Disposition: attachment; filename=vt_buf.diff

LS0tIHN5cy9kZXYvdnQvdnRfYnVmLmMub3JpZwkyMDIyLTA4LTAyIDA4OjQ0OjI3LjIyOTc4MjAw
MCAtMDMwMA0KKysrIHN5cy9kZXYvdnQvdnRfYnVmLmMJMjAyMi0wOC0wMiAwODo0NTowMi43MDM2
OTcwMDAgLTAzMDANCkBAIC03NzEsNyArNzcxLDcgQEANCiB9DQogDQogdm9pZA0KLXZ0YnVmX2V4
dHJhY3RfbWFya2VkKHN0cnVjdCB2dF9idWYgKnZiLCB0ZXJtX2NoYXJfdCAqYnVmLCBpbnQgc3op
DQordnRidWZfZXh0cmFjdF9tYXJrZWQoc3RydWN0IHZ0X2J1ZiAqdmIsIHRlcm1fY2hhcl90ICpi
dWYsIGludCBzeiwgaW50IG1hcmspDQogew0KIAlpbnQgaSwgaiwgciwgYywgY3MsIGNlOw0KIAl0
ZXJtX3Bvc190IHMsIGU7DQpAQCAtNzk5LDcgKzc5OSw3IEBADQogCQkJYnVmW2krK10gPSB2Yi0+
dmJfcm93c1tyXVtjXTsNCiANCiAJCS8qIEZvciBhbGwgcm93cywgYnV0IHRoZSBsYXN0IG9uZS4g
Ki8NCi0JCWlmIChyICE9IGUudHBfcm93KSB7DQorCQlpZiAociAhPSBlLnRwX3JvdyB8fCBtYXJr
ID09IFZUQl9NQVJLX1JPVykgew0KIAkJCS8qIFRyaW0gdHJhaWxpbmcgd29yZCBzZXBhcmF0b3Jz
LCBpZiBhbnkuICovDQogCQkJZm9yICg7IGkgIT0gajsgaS0tKSB7DQogCQkJCWlmICghdGNoYXJf
aXNfd29yZF9zZXBhcmF0b3IoYnVmW2kgLSAxXSkpDQo=

--3432851520-1375550816-1659443668=:1751
Content-Type: text/plain; charset=US-ASCII; name=vt_core.diff
Content-Transfer-Encoding: BASE64
Content-ID: <fd16416-22b-685-ac8d-76b9a73c5b7a@hotmail.com>
Content-Description:
Content-Disposition: attachment; filename=vt_core.diff

LS0tIHN5cy9kZXYvdnQvdnRfY29yZS5jLm9yaWcJMjAyMi0wOC0wMiAwODo0MzoxNS40MzY0MTUw
MDAgLTAzMDANCisrKyBzeXMvZGV2L3Z0L3Z0X2NvcmUuYwkyMDIyLTA4LTAyIDA4OjQzOjQ5LjEy
MDA5NjAwMCAtMDMwMA0KQEAgLTIyODcsNyArMjI4Nyw3IEBADQogCQkJVkRfUEFTVEVCVUZTWih2
ZCkgPSBsZW47DQogCQl9DQogCQkvKiBSZXF1ZXN0IGNvcHkvcGFzdGUgYnVmZmVyIGRhdGEsIG5v
IG1vcmUgdGhhbiBgbGVuJyAqLw0KLQkJdnRidWZfZXh0cmFjdF9tYXJrZWQoJnZ3LT52d19idWYs
IFZEX1BBU1RFQlVGKHZkKSwgbGVuKTsNCisJCXZ0YnVmX2V4dHJhY3RfbWFya2VkKCZ2dy0+dndf
YnVmLCBWRF9QQVNURUJVRih2ZCksIGxlbiwgbWFyayk7DQogDQogCQlWRF9QQVNURUJVRkxFTih2
ZCkgPSBsZW47DQogDQo=

--3432851520-1375550816-1659443668=:1751--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CP6P284MB1900DD45138428B4612DF7ACCB9D9>