Commit 9bb6e3fe authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark
Browse files

Fix crash when extending selection after switching between primary and secondary screen

BUG: 398320
parent 23024d4b
......@@ -49,6 +49,11 @@ void ScreenWindow::setScreen(Screen *screen)
{
Q_ASSERT(screen);
if (screen == _screen) {
return;
}
emit screenAboutToChange();
_screen = screen;
}
......
......@@ -257,6 +257,11 @@ Q_SIGNALS:
/** Emitted when the selection is changed. */
void selectionChanged();
/** Emitted when e. g. Screen is changed (to alternate or primary), so
* initial selection offsets etc. are invalidated.
*/
void screenAboutToChange();
private:
Q_DISABLE_COPY(ScreenWindow)
......
......@@ -139,6 +139,11 @@ void TerminalDisplay::setScreenWindow(ScreenWindow* window)
connect(_screenWindow.data(), &Konsole::ScreenWindow::outputChanged, this, [this]() {
_filterUpdateRequired = true;
});
connect(_screenWindow.data(), &Konsole::ScreenWindow::screenAboutToChange, this, [this]() {
_iPntSel = QPoint();
_pntSel = QPoint();
_tripleSelBegin = QPoint();
});
connect(_screenWindow.data(), &Konsole::ScreenWindow::scrolled, this, [this]() {
_filterUpdateRequired = true;
});
......
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