# HG changeset patch # User Carl Byington # Date 1401419758 25200 # Node ID 48a8daea92219a650fac5f054b98687b8941cee0 # Parent 1588e359a97223ae95d742cf7a4ffd6d11ead27d delay sending cursor move notifications until the host is quiet diff -r 1588e359a972 -r 48a8daea9221 src/com/five_ten_sg/connectbot/service/TerminalMonitor.java --- a/src/com/five_ten_sg/connectbot/service/TerminalMonitor.java Thu May 29 12:40:27 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/service/TerminalMonitor.java Thu May 29 20:15:58 2014 -0700 @@ -46,7 +46,10 @@ private int end_line = 500; // "" private int start_column = 0; // "" private int end_column = 500; // "" - private boolean modified = false; // "" + private boolean modified = false; // used to delay screen change notifications + private boolean moved = false; // used to delay cursor moved notifications + private int to_line = 0; // "" + private int to_column = 0; // "" private HashMap keymap = null; private IBinder bound = null; private Socket monitor_socket = null; @@ -323,6 +326,12 @@ } public synchronized void cursorMove(int l, int c) { + moved = true; + to_line = l + to_column = c; + } + + public void cursorMoved() { char[] arg = new char[4]; arg[2] = (char)(l & 0x0000ffff); arg[3] = (char)(c & 0x0000ffff); @@ -334,6 +343,10 @@ modified = false; sendScreen(MONITOR_CMD_SCREENCHANGE); } + if (moved) { + moved = false; + cursorMoved(); + } } public synchronized void screenChanged(int llow, int lhigh, int clow, int chigh) {