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
Change-Id: Ic2b1d0f293c92fec7ec697b2fe3d1da9fd0d0e44
(cherry picked from commit 77e0e7c414b7547a36734cfea3e5b237329c93ab)
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
Wladimir Leuschner 2023-10-17 14:25:25 +02:00 committed by Oliver Wolff
parent c658a9e618
commit a4ea450334

View File

@ -208,8 +208,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())