GNOME Bugzilla – Bug 683729
Spurious mouse release is reported when Shift is held down
Last modified: 2014-04-06 18:15:26 UTC
Enable mouse reporting, e.g. by echo -n $'\e[?1000h' (or its 1002 counterpart). Hold down the Shift modifier, click and hold the mouse button, drag the mouse, release the mouse button, release Shift -> nothing is reported in the terminal, as expected. (Highlighting is performed by the terminal itself). Now omit the dragging part. While holding Shift, just click and release the mouse button. The release event is reported to the application (although click isn't). This might confuse applications, and is not logical at all. In accordance with xterm, such release shouldn't be reported.
Created attachment 223932 [details] [review] Suggested fix I hope this patch is the right solution for the problem. Maybe a comment explaining what goes on, or a more explicit if (terminal->pvt->selecting_after_threshold) { return TRUE; } return FALSE; might make it cleaner, not sure. pvt->selecting is only set when dragging starts, but the _vte_terminal_maybe_end_selection method should also return TRUE to signal that it has done its job if this is still FALSE but vte->selecting_after_threshold is TRUE meaning that a Shift-Click has already occurred.
Makes sense; fixed on 0-34 and next. Thanks for the patch!