summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <[email protected]>2018-03-25 11:56:24 -0400
committerKurt Hindenburg <[email protected]>2018-03-25 11:58:26 -0400
commit9fdff87b6890792c04188a77da62c8ed1aea259a (patch)
tree10e7b586aab43a48409396a9a595db93da905e5e
parent7f2af0da1d3da1b232b57f5a98399601e53850b0 (diff)
Mostly revert of "Allow view-controlling keys in read-only mode"
I should have just reverted the entire commit. (cherry picked from commit 4c68ff3faa70a9c427c3adaf9b4e427c8f092416)
-rw-r--r--src/TerminalDisplay.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp
index 2f2af66..ca02dd5 100644
--- a/src/TerminalDisplay.cpp
+++ b/src/TerminalDisplay.cpp
@@ -3421,6 +3421,12 @@ void TerminalDisplay::scrollScreenWindow(enum ScreenWindow::RelativeScrollMode m
void TerminalDisplay::keyPressEvent(QKeyEvent* event)
{
+
+ if (_readOnly) {
+ event->accept();
+ return;
+ }
+
if ((_urlHintsModifiers != 0u) && event->modifiers() == _urlHintsModifiers) {
int hintSelected = event->key() - 0x31;
if (hintSelected >= 0 && hintSelected < 10 && hintSelected < _filterChain->hotSpots().count()) {
@@ -3437,29 +3443,25 @@ void TerminalDisplay::keyPressEvent(QKeyEvent* event)
}
}
- if (!_readOnly) {
- _screenWindow->screen()->setCurrentTerminalDisplay(this);
+ _screenWindow->screen()->setCurrentTerminalDisplay(this);
- _actSel = 0; // Key stroke implies a screen update, so TerminalDisplay won't
- // know where the current selection is.
+ _actSel = 0; // Key stroke implies a screen update, so TerminalDisplay won't
+ // know where the current selection is.
- if (_allowBlinkingCursor) {
- _blinkCursorTimer->start();
- if (_cursorBlinking) {
- // if cursor is blinking(hidden), blink it again to show it
- blinkCursorEvent();
- }
- Q_ASSERT(!_cursorBlinking);
+ if (_allowBlinkingCursor) {
+ _blinkCursorTimer->start();
+ if (_cursorBlinking) {
+ // if cursor is blinking(hidden), blink it again to show it
+ blinkCursorEvent();
}
+ Q_ASSERT(!_cursorBlinking);
}
emit keyPressedSignal(event);
#ifndef QT_NO_ACCESSIBILITY
- if (!_readOnly) {
- QAccessibleTextCursorEvent textCursorEvent(this, _usedColumns * screenWindow()->screen()->getCursorY() + screenWindow()->screen()->getCursorX());
- QAccessible::updateAccessibility(&textCursorEvent);
- }
+ QAccessibleTextCursorEvent textCursorEvent(this, _usedColumns * screenWindow()->screen()->getCursorY() + screenWindow()->screen()->getCursorX());
+ QAccessible::updateAccessibility(&textCursorEvent);
#endif
event->accept();