Commit d70fc5ee authored by Luis Javier Merino's avatar Luis Javier Merino Committed by Tomaz Canabrava
Browse files

Make mouse tracking modes mutually exclusive

On xterm, modes 9 (X10 legacy, button press), 1000 (button press and
release), 1001 (mouse highlight tracking), 1002 (mouse drag) 1003 (mouse
move) and DECELR (DEC Locator) are mutually exclusive.

So are 1005 (extended coordinates mode), 1006 (SGR extended
coordinates), 1015 (urxvt extended coordinates) and 1016 (use pixel
coordinates).

On xterm, disabling any of the 9, 1000, 1001, 1002, 1003, DECELR modes
disables mouse tracking.  To disable the extended coordinate modes
(1005, 1006, 1015, 1016), the current mode should be disabled.

So, do the same for the modes Konsole supports.
parent 1a63b91d
......@@ -1416,11 +1416,24 @@ void Vt102Emulation::setMode(int m)
case MODE_Mouse1001:
case MODE_Mouse1002:
case MODE_Mouse1003:
_currentModes.mode[MODE_Mouse1000] = false;
_currentModes.mode[MODE_Mouse1001] = false;
_currentModes.mode[MODE_Mouse1002] = false;
_currentModes.mode[MODE_Mouse1003] = false;
_currentModes.mode[m] = true;
Q_EMIT programRequestsMouseTracking(true);
break;
case MODE_Mouse1007:
Q_EMIT enableAlternateScrolling(true);
break;
case MODE_Mouse1005:
case MODE_Mouse1006:
case MODE_Mouse1015:
_currentModes.mode[MODE_Mouse1005] = false;
_currentModes.mode[MODE_Mouse1006] = false;
_currentModes.mode[MODE_Mouse1015] = false;
_currentModes.mode[m] = true;
break;
case MODE_BracketedPaste:
Q_EMIT programBracketedPasteModeChanged(true);
......@@ -1453,6 +1466,12 @@ void Vt102Emulation::resetMode(int m)
case MODE_Mouse1001:
case MODE_Mouse1002:
case MODE_Mouse1003:
// Same behavior as xterm, these modes are mutually exclusive,
// and disabling any disables mouse tracking.
_currentModes.mode[MODE_Mouse1000] = false;
_currentModes.mode[MODE_Mouse1001] = false;
_currentModes.mode[MODE_Mouse1002] = false;
_currentModes.mode[MODE_Mouse1003] = false;
Q_EMIT programRequestsMouseTracking(false);
break;
case MODE_Mouse1007:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment