From 2a6e520a7a92fe796add82f77cda922c54e091b9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 11 Nov 2020 14:50:44 +0100 Subject: [PATCH] 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 --- src/session/Session.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/session/Session.cpp b/src/session/Session.cpp index 4811f224..00a3b17b 100644 --- a/src/session/Session.cpp +++ b/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);