After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 745074 - Mouse 1003 mode reports wrong button
Mouse 1003 mode reports wrong button
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.39.x
Other Linux
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-24 09:59 UTC by Egmont Koblinger
Modified: 2015-02-27 11:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix (4.20 KB, patch)
2015-02-24 20:15 UTC, Egmont Koblinger
committed Details | Review

Description Egmont Koblinger 2015-02-24 09:59:20 UTC
Found at https://bugzilla.redhat.com/show_bug.cgi?id=1195481, sibling of bug 736447

When the mouse is moved without any buttons being pressed, button 0 (left) is reported instead of 3 (none).

Test with
echo -ne '\e[?1003h\e[?1006h'

(1006 is only for more readable output; notice xterm reports 35 vs. vte 32)
Comment 1 Egmont Koblinger 2015-02-24 16:12:39 UTC
The easy bits: vte_terminal_feed_mouse_event() forgets to map button==0 -> cb=3.

The bit more complicated bits: We need to keep track of which buttons are pressed (probably more at the same time) and report one of them when there's a motion.  Xterm seems to report the lowest one that's pressed at that time.
Comment 2 Egmont Koblinger 2015-02-24 20:15:46 UTC
Created attachment 297821 [details] [review]
Fix

Fix v1, I hope it's okay.

Does anyone have a 3-button mouse and could double check xterm's behavior? (Otherwise I'll have to dig into its source to verify that indeed the leftmost pressed button is reported on movement.)
Comment 3 Egmont Koblinger 2015-02-24 21:06:59 UTC
Nevermind, I've checked xterm's source. Its mouse_button is a bitmap just like in my patch, and on drag it emits FirstBitN(screen->mouse_button). It's pretty straightforward and is obviously the same.
Comment 4 Egmont Koblinger 2015-02-27 11:40:18 UTC
Fixed