From 2d4e78c1f2c00c67ba93e2b4480ad1f077daacc3 Mon Sep 17 00:00:00 2001 From: Andreas Opferkuch Date: Thu, 2 Aug 2018 21:07:22 +0200 Subject: [PATCH] Set tooltip in tray_update instead of tray_init --- tray.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tray.h b/tray.h index 7874e0b..afcc5e0 100644 --- a/tray.h +++ b/tray.h @@ -311,10 +311,6 @@ static int tray_init(struct tray *tray) { nid.uID = 0; nid.uFlags = NIF_ICON | NIF_MESSAGE; nid.uCallbackMessage = WM_TRAY_CALLBACK_MESSAGE; - if(tray->tooltip != 0 && strlen(tray->tooltip) > 0) { - strncpy(nid.szTip, tray->tooltip, sizeof(nid.szTip)); - nid.uFlags |= NIF_TIP; - } Shell_NotifyIcon(NIM_ADD, &nid); tray_update(tray); @@ -347,6 +343,10 @@ static void tray_update(struct tray *tray) { DestroyIcon(nid.hIcon); } nid.hIcon = icon; + if(tray->tooltip != 0 && strlen(tray->tooltip) > 0) { + strncpy(nid.szTip, tray->tooltip, sizeof(nid.szTip)); + nid.uFlags |= NIF_TIP; + } Shell_NotifyIcon(NIM_MODIFY, &nid); if (prevmenu != NULL) {