diff options
Diffstat (limited to 'st.c')
| -rw-r--r-- | st.c | 22 |
1 files changed, 13 insertions, 9 deletions
| @@ -823,18 +823,23 @@ mousereport(XEvent *e) { | |||
| 823 | button = oldbutton + 32; | 823 | button = oldbutton + 32; |
| 824 | ox = x; | 824 | ox = x; |
| 825 | oy = y; | 825 | oy = y; |
| 826 | } else if(!IS_SET(MODE_MOUSESGR) | ||
| 827 | && (e->xbutton.type == ButtonRelease | ||
| 828 | || button == AnyButton)) { | ||
| 829 | button = 3; | ||
| 830 | } else { | 826 | } else { |
| 831 | button -= Button1; | 827 | if(!IS_SET(MODE_MOUSESGR) && e->xbutton.type == ButtonRelease) { |
| 832 | if(button >= 3) | 828 | button = 3; |
| 833 | button += 64 - 3; | 829 | } else { |
| 830 | button -= Button1; | ||
| 831 | if(button >= 3) | ||
| 832 | button += 64 - 3; | ||
| 833 | } | ||
| 834 | if(e->xbutton.type == ButtonPress) { | 834 | if(e->xbutton.type == ButtonPress) { |
| 835 | oldbutton = button; | 835 | oldbutton = button; |
| 836 | ox = x; | 836 | ox = x; |
| 837 | oy = y; | 837 | oy = y; |
| 838 | } else if(e->xbutton.type == ButtonRelease) { | ||
| 839 | oldbutton = 3; | ||
| 840 | /* MODE_MOUSEX10: no button release reporting */ | ||
| 841 | if(IS_SET(MODE_MOUSEX10)) | ||
| 842 | return; | ||
| 838 | } | 843 | } |
| 839 | } | 844 | } |
| 840 | 845 | ||
| @@ -851,8 +856,7 @@ mousereport(XEvent *e) { | |||
| 851 | e->xbutton.type == ButtonRelease ? 'm' : 'M'); | 856 | e->xbutton.type == ButtonRelease ? 'm' : 'M'); |
| 852 | } else if(x < 223 && y < 223) { | 857 | } else if(x < 223 && y < 223) { |
| 853 | len = snprintf(buf, sizeof(buf), "\033[M%c%c%c", | 858 | len = snprintf(buf, sizeof(buf), "\033[M%c%c%c", |
| 854 | IS_SET(MODE_MOUSEX10)? button-1 : 32+button, | 859 | 32+button, 32+x+1, 32+y+1); |
| 855 | 32+x+1, 32+y+1); | ||
| 856 | } else { | 860 | } else { |
| 857 | return; | 861 | return; |
| 858 | } | 862 | } |
