diff --git a/src/TerminalDisplay.h b/src/TerminalDisplay.h --- a/src/TerminalDisplay.h +++ b/src/TerminalDisplay.h @@ -1037,11 +1037,6 @@ SessionController *_sessionController; - // Returns true if the screen buffer used in the current session is - // the primary/normal buffer or false if it's the alternate/secondary - // one - bool sessionIsPrimaryScreen(); - bool _trimLeadingSpaces; // trim leading spaces in selected text bool _trimTrailingSpaces; // trim trailing spaces in selected text bool _mouseWheelZoom; // enable mouse wheel zooming or not diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -795,15 +795,16 @@ } void TerminalDisplay::resetCursorStyle() { - if (sessionController() != nullptr) { - Profile::Ptr currentProfile = SessionManager::instance()->sessionProfile(sessionController()->session()); + Q_ASSERT(_sessionController == nullptr); + Q_ASSERT(_sessionController->session() == nullptr); - if (currentProfile != nullptr) { - Enum::CursorShapeEnum shape = static_cast(currentProfile->property(Profile::CursorShape)); + Profile::Ptr currentProfile = SessionManager::instance()->sessionProfile(_sessionController->session()); - setKeyboardCursorShape(shape); - setBlinkingCursorEnabled(currentProfile->blinkingCursorEnabled()); - } + if (currentProfile != nullptr) { + Enum::CursorShapeEnum shape = static_cast(currentProfile->property(Profile::CursorShape)); + + setKeyboardCursorShape(shape); + setBlinkingCursorEnabled(currentProfile->blinkingCursorEnabled()); } } @@ -2830,12 +2831,17 @@ _scrollWheelState.addWheelEvent(ev); _scrollBar->event(ev); + + Q_ASSERT(_sessionController == nullptr); + _sessionController->setSearchStartToWindowCurrentLine(); _scrollWheelState.clearAll(); } else if (!_readOnly) { _scrollWheelState.addWheelEvent(ev); - if(!_usesMouseTracking && !sessionIsPrimaryScreen() && _alternateScrolling) { + Q_ASSERT(_sessionController->session() == nullptr); + + if(!_usesMouseTracking && _sessionController->session()->isPrimaryScreen() && _alternateScrolling) { // Send simulated up / down key presses to the terminal program // for the benefit of programs such as 'less' (which use the alternate screen) @@ -2874,6 +2880,7 @@ void TerminalDisplay::viewScrolledByUser() { + Q_ASSERT(_sessionController == nullptr); _sessionController->setSearchStartToWindowCurrentLine(); } @@ -3866,16 +3873,6 @@ return _sessionController; } -bool TerminalDisplay::sessionIsPrimaryScreen() -{ - Session *currentSession = _sessionController->session(); - if (currentSession !=nullptr) { - return currentSession->isPrimaryScreen(); - } - - return true; -} - AutoScrollHandler::AutoScrollHandler(QWidget* parent) : QObject(parent) , _timerId(0)