Windows: Avoid triggering QPlatformWindow creation when setting app badge
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 <Mikolaj.Boc@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
parent
8eab4e4850
commit
a62f49e736
@ -773,6 +773,8 @@ void QWindowsIntegration::setApplicationBadge(const QImage &image)
|
|||||||
// the other windows will take over in showing the badge.
|
// the other windows will take over in showing the badge.
|
||||||
const auto topLevelWindows = QGuiApplication::topLevelWindows();
|
const auto topLevelWindows = QGuiApplication::topLevelWindows();
|
||||||
for (auto *topLevelWindow : topLevelWindows) {
|
for (auto *topLevelWindow : topLevelWindows) {
|
||||||
|
if (!topLevelWindow->handle())
|
||||||
|
continue;
|
||||||
auto hwnd = reinterpret_cast<HWND>(topLevelWindow->winId());
|
auto hwnd = reinterpret_cast<HWND>(topLevelWindow->winId());
|
||||||
taskbarList->SetOverlayIcon(hwnd, hIcon, L"");
|
taskbarList->SetOverlayIcon(hwnd, hIcon, L"");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user