Commit 877a5128 authored by Luis Javier Merino's avatar Luis Javier Merino Committed by Kurt Hindenburg
Browse files

Fix assert _currentTerminalDisplay in Screen::setTextSelectionRendition

_currentTerminalDisplay was not set until some interaction was made with
the TerminalDisplay widget.  Set it as soon as Session->addView() is
called.

BUG: 439529
parent 462b24c5
......@@ -84,6 +84,12 @@ ScreenWindow *Emulation::createWindow()
return window;
}
void Emulation::setCurrentTerminalDisplay(TerminalDisplay *display)
{
_screen[0]->setCurrentTerminalDisplay(display);
_screen[1]->setCurrentTerminalDisplay(display);
}
void Emulation::checkScreenInUse()
{
Q_EMIT primaryScreenInUse(_currentScreen == _screen[0]);
......
......@@ -15,6 +15,7 @@
// Konsole
#include "Enumeration.h"
#include "terminalDisplay/TerminalDisplay.h"
#include "konsoleprivate_export.h"
#include <memory>
......@@ -93,6 +94,11 @@ public:
*/
ScreenWindow *createWindow();
/**
* Associates a TerminalDisplay with this emulation.
*/
void setCurrentTerminalDisplay(TerminalDisplay *display);
/** Returns the size of the screen image which the emulation produces */
QSize imageSize() const;
......
......@@ -339,6 +339,8 @@ void Session::addView(TerminalDisplay* widget)
widget->setScreenWindow(_emulation->createWindow());
_emulation->setCurrentTerminalDisplay(widget);
//connect view signals and slots
connect(widget, &Konsole::TerminalDisplay::changedContentSizeSignal, this, &Konsole::Session::onViewSizeChange);
......
......@@ -1140,8 +1140,6 @@ void TerminalDisplay::mousePressEvent(QMouseEvent* ev)
return;
}
_screenWindow->screen()->setCurrentTerminalDisplay(this);
if (_possibleTripleClick && (ev->button() == Qt::LeftButton)) {
mouseTripleClickEvent(ev);
return;
......@@ -1707,7 +1705,6 @@ void TerminalDisplay::wheelEvent(QWheelEvent* ev)
QKeyEvent keyEvent(QEvent::KeyPress, keyCode, Qt::NoModifier);
for (int i = 0; i < abs(lines); i++) {
_screenWindow->screen()->setCurrentTerminalDisplay(this);
Q_EMIT keyPressedSignal(&keyEvent);
}
} else if (_usesMouseTracking) {
......@@ -2486,8 +2483,6 @@ void TerminalDisplay::keyPressEvent(QKeyEvent* event)
peekPrimaryRequested(true);
}
_screenWindow->screen()->setCurrentTerminalDisplay(this);
if (!_readOnly) {
_actSel = 0; // Key stroke implies a screen update, so TerminalDisplay won't
// know where the current selection is.
......
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