---
I came across these when porting st to wayland (if you're interested in that,
watch the wayland mailing list).
I haven't actually run into any of these bugs (I don't use terminal mouse
support), but these changes seem correct to me based on [0].
Any feedback or testing is welcome!
st.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/st.c b/st.c
index 947373f..8992998 100644
--- a/st.c
+++ b/st.c
_AT_@ -818,18 +818,23 @@ mousereport(XEvent *e) {
button = oldbutton + 32;
ox = x;
oy = y;
- } else if(!IS_SET(MODE_MOUSESGR)
- && (e->xbutton.type == ButtonRelease
- || button == AnyButton)) {
- button = 3;
} else {
- button -= Button1;
- if(button >= 3)
- button += 64 - 3;
+ if(!IS_SET(MODE_MOUSESGR) && e->xbutton.type == ButtonRelease) {
+ button = 3;
+ } else {
+ button -= Button1;
+ if(button >= 3)
+ button += 64 - 3;
+ }
if(e->xbutton.type == ButtonPress) {
oldbutton = button;
ox = x;
oy = y;
+ } else if(e->xbutton.type == ButtonRelease) {
+ oldbutton = 3;
+ /* MODE_MOUSEX10: no button release reporting */
+ if(IS_SET(MODE_MOUSEX10))
+ return;
}
}
_AT_@ -846,8 +851,7 @@ mousereport(XEvent *e) {
e->xbutton.type == ButtonRelease ? 'm' : 'M');
} else if(x < 223 && y < 223) {
len = snprintf(buf, sizeof(buf), "\033[M%c%c%c",
- IS_SET(MODE_MOUSEX10)? button-1 : 32+button,
- 32+x+1, 32+y+1);
+ 32+button, 32+x+1, 32+y+1);
} else {
return;
}
--
1.8.3
Received on Fri Jul 26 2013 - 01:19:19 CEST
This archive was generated by hypermail 2.3.0 : Fri Jul 26 2013 - 01:24:05 CEST