Set tooltip in tray_update instead of tray_init
This commit is contained in:
committed by
Dmitry Mikushin
parent
4fd58d2a5c
commit
2d4e78c1f2
8
tray.h
8
tray.h
@@ -311,10 +311,6 @@ static int tray_init(struct tray *tray) {
|
|||||||
nid.uID = 0;
|
nid.uID = 0;
|
||||||
nid.uFlags = NIF_ICON | NIF_MESSAGE;
|
nid.uFlags = NIF_ICON | NIF_MESSAGE;
|
||||||
nid.uCallbackMessage = WM_TRAY_CALLBACK_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);
|
Shell_NotifyIcon(NIM_ADD, &nid);
|
||||||
|
|
||||||
tray_update(tray);
|
tray_update(tray);
|
||||||
@@ -347,6 +343,10 @@ static void tray_update(struct tray *tray) {
|
|||||||
DestroyIcon(nid.hIcon);
|
DestroyIcon(nid.hIcon);
|
||||||
}
|
}
|
||||||
nid.hIcon = icon;
|
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);
|
Shell_NotifyIcon(NIM_MODIFY, &nid);
|
||||||
|
|
||||||
if (prevmenu != NULL) {
|
if (prevmenu != NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user