From 662a0c8f5c086f593a0bbe0d517319d247821cb9 Mon Sep 17 00:00:00 2001 From: Laurent Trinques Date: Sun, 18 Oct 2026 17:05:48 +0200 Subject: [PATCH] Terminal block manager: really show the opening message One pass of the event loop after show() was not enough: the message box was not painted yet when the long work started (seen on Wayland), only the busy cursor was visible. Wait for the window of the message to be exposed by the window system (500 ms at most), then paint it before building the manager. --- .../ui/terminalstripeditorwindow.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sources/TerminalStrip/ui/terminalstripeditorwindow.cpp b/sources/TerminalStrip/ui/terminalstripeditorwindow.cpp index aee833db9..cc1d86a94 100644 --- a/sources/TerminalStrip/ui/terminalstripeditorwindow.cpp +++ b/sources/TerminalStrip/ui/terminalstripeditorwindow.cpp @@ -30,7 +30,10 @@ #include "terminalstriptreedockwidget.h" #include +#include #include +#include +#include QPointer TerminalStripEditorWindow::window_; @@ -53,7 +56,21 @@ TerminalStripEditorWindow *TerminalStripEditorWindow::instance(QETProject *proje busy_.setCancelButton(nullptr); busy_.setMinimumDuration(0); busy_.show(); - //Paint the message before the long work starts + //Paint the message before the long work starts. One pass of the + //event loop is not enough : the window is shown by the window system + //(Wayland compositor...) a bit later. Wait for it to be exposed, + //a short time at most, then paint it. + QElapsedTimer timer_; + timer_.start(); + while (timer_.elapsed() < 500) + { + QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents, 20); + if (busy_.windowHandle() && busy_.windowHandle()->isExposed()) { + break; + } + QThread::msleep(5); + } + busy_.repaint(); QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); QApplication::setOverrideCursor(Qt::WaitCursor);