Skip to content

Commit

Permalink
hterm: return early on mouse move events when possible
Browse files Browse the repository at this point in the history
Add an explicit check for when mouse drag reporting is disabled, but
mouse click reporting is enabled.  Otherwise we do a bunch of early
event processing whenever the mouse moves across the screen even if
we don't actually report it.  We special case mouse movement as it
is a pretty common event and it makes debugging non-mouse moves a
bit of a pita.

Change-Id: I7f82a66348f1d1f93523a773b1b69173464c26c6
Reviewed-on: https://chromium-review.googlesource.com/764752
Reviewed-by: Brandon Gilmore <[email protected]>
Tested-by: Mike Frysinger <[email protected]>
  • Loading branch information
vapier committed Nov 20, 2017
1 parent 072496f commit d7b048c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hterm/js/hterm_vt.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,11 @@ hterm.VT.prototype.reset = function() {
* See the "Mouse Tracking" section of [xterm].
*/
hterm.VT.prototype.onTerminalMouse_ = function(e) {
// Short circuit a few events to avoid unnecessary processing.
if (this.mouseReport == this.MOUSE_REPORT_DISABLED)
return;
else if (this.mouseReport != this.MOUSE_REPORT_DRAG && e.type == 'mousemove')
return;

// Temporary storage for our response.
var response;
Expand Down

0 comments on commit d7b048c

Please sign in to comment.