Fix setting SysTrayIcon visible after explicitly hiding it

After hiding the QSystemTrayIcon explicitly with .setVisible(false)
resetting visibility with .setVisible(true) does not generate NIM_MODIFY
message and thus preventing the tray icon from being visible again.

Fixes: QTBUG-118133
Pick-to: 6.5
Change-Id: Ic2b1d0f293c92fec7ec697b2fe3d1da9fd0d0e44
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
(cherry picked from commit 77e0e7c414b7547a36734cfea3e5b237329c93ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Wladimir Leuschner 2023-10-17 14:25:25 +02:00 committed by Qt Cherry-pick Bot
parent 37750aa8d1
commit 72331b450d

View File

@ -162,8 +162,6 @@ void QWindowsSystemTrayIcon::cleanup()
void QWindowsSystemTrayIcon::updateIcon(const QIcon &icon)
{
qCDebug(lcQpaTrayIcon) << __FUNCTION__ << '(' << icon << ')' << this;
if (icon.cacheKey() == m_icon.cacheKey())
return;
m_icon = icon;
const HICON hIconToDestroy = createIcon(icon);
if (ensureInstalled())