From a62f49e7367e857df6e28be507e68a994106127f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 5 Dec 2022 15:21:06 +0100 Subject: [PATCH] Windows: Avoid triggering QPlatformWindow creation when setting app badge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calling QWindow::winId() will create the platform window if it hasn't been created yet, which is not what we want. Change-Id: I9d4ecb863f961fd3cef6d13e27bf175bf55eabcf Reviewed-by: MikoĊ‚aj Boc Reviewed-by: Eirik Aavitsland --- src/plugins/platforms/windows/qwindowsintegration.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index bf5e73f0021..7fd3f4fcc1d 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -773,6 +773,8 @@ void QWindowsIntegration::setApplicationBadge(const QImage &image) // the other windows will take over in showing the badge. const auto topLevelWindows = QGuiApplication::topLevelWindows(); for (auto *topLevelWindow : topLevelWindows) { + if (!topLevelWindow->handle()) + continue; auto hwnd = reinterpret_cast(topLevelWindow->winId()); taskbarList->SetOverlayIcon(hwnd, hIcon, L""); }