ensure that window size is correct before starting session (again)

commit b84c0f49 replaced the previous hack, clearly failing to notice
that in-thread qobject conections are direct by default. we need to make
the competing connection queued instead.

this remains a hack; a proper solution would be avoiding the instant
resize by skipping the initialization to 80x25, but i'm not going to
touch any of that mess.

BUG: 412598
wilder
Oswald Buddenhagen 5 years ago
parent 5729e67120
commit 2a6e520a7a
  1. 8
      src/session/Session.cpp

@ -182,10 +182,12 @@ void Session::openTeletype(int fd, bool runShell)
this, &Konsole::Session::done);
// emulator size
// 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::imageSizeChanged, this, &Konsole::Session::updateWindowSize);
if (fd < 0 || runShell) {
connect(_emulation, &Konsole::Emulation::imageSizeInitialized, this, &Konsole::Session::run);
// Using a queued connection guarantees that starting the session
// is delayed until all (both) image size updates at startup have
// been processed. See #203185 and #412598.
connect(_emulation, &Konsole::Emulation::imageSizeInitialized, this, &Konsole::Session::run, Qt::QueuedConnection);
} else {
// run needs to be disconnected, as it may be already connected by the constructor
disconnect(_emulation, &Konsole::Emulation::imageSizeInitialized, this, &Konsole::Session::run);

Loading…
Cancel
Save