From 6e2f3118731d13839faf63077cba1d141e7c0af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 17 Oct 2023 16:06:19 +0200 Subject: [PATCH] Windows: Don't re-apply application badge if one has not been set We need to re-apply the application badge when the color scheme changes; when a task bar button is being created for the fist time; or after Explorer has crashed and re-started. But we should only do that if the user has set an application badge via our APIs. Otherwise we might end up clearing an existing badge that was set via the native APIs directly. Fixes: QTBUG-118117 Pick-to: 6.5 Change-Id: I1f1fecba44c118d4e3f7ef4119139c3ebd23f047 Reviewed-by: Oliver Wolff (cherry picked from commit 8f2828683e2ac44a282e8f061de1c76925abcec1) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/windows/qwindowsintegration.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 628b2f32096..c87f77da17a 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -785,7 +785,8 @@ void QWindowsIntegration::updateApplicationBadge() // to a task bar button being created for the fist time or after // Explorer had crashed and re-started. In any case, re-apply the // badge so that everything is up to date. - setApplicationBadge(m_applicationBadgeNumber); + if (m_applicationBadgeNumber) + setApplicationBadge(m_applicationBadgeNumber); } #if QT_CONFIG(vulkan)