Remove hack for ensuring window size is correct before starting session

Instead of using a hardcoded delay and hope that the signals are handled
in the right order just use a direct connection for the first signal so
we can guarantee that it is handled before the execution continues to
the emission of the second signal.

REVIEW: 127724
parent ed51b007
......@@ -356,12 +356,7 @@ void Emulation::setImageSize(int lines, int columns)
if (!_imageSizeInitialized) {
_imageSizeInitialized = true;
// FIXME
// a hard-coded, small delay is introduced to guarantee Session::run()
// does not get triggered by SIGNAL(imageSizeInitialized()) before
// Pty::setWindowSize() is triggered by previously emitted
// SIGNAL(imageSizeChanged()); See #203185
QTimer::singleShot(200, this, SIGNAL(imageSizeInitialized()));
emit imageSizeInitialized();
}
}
......
......@@ -186,7 +186,8 @@ void Session::openTeletype(int fd)
connect(_shellProcess, static_cast<void(Pty::*)(int,QProcess::ExitStatus)>(&Konsole::Pty::finished), this, &Konsole::Session::done);
// emulator size
connect(_emulation, &Konsole::Emulation::imageSizeChanged, this, &Konsole::Session::updateWindowSize);
// Use a direct connection to ensure that the window size is set before it runs
connect(_emulation, &Konsole::Emulation::imageSizeChanged, this, &Konsole::Session::updateWindowSize, Qt::DirectConnection);
connect(_emulation, &Konsole::Emulation::imageSizeInitialized, this, &Konsole::Session::run);
}
......
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