diff --git a/gtk/gtkstatusicon.c b/gtk/gtkstatusicon.c index 7e7ab22a44..678cb8caab 100644 --- a/gtk/gtkstatusicon.c +++ b/gtk/gtkstatusicon.c @@ -903,6 +903,17 @@ gtk_status_icon_init (GtkStatusIcon *status_icon) priv->nid.uCallbackMessage = WM_GTK_TRAY_NOTIFICATION; priv->nid.uFlags = NIF_MESSAGE; + /* To help win7 identify the icon create it with an application "unique" tip */ + if (g_get_prgname ()) + { + WCHAR *wcs = g_utf8_to_utf16 (g_get_prgname (), -1, NULL, NULL, NULL); + + priv->nid.uFlags |= NIF_TIP; + wcsncpy (priv->nid.szTip, wcs, G_N_ELEMENTS (priv->nid.szTip) - 1); + priv->nid.szTip[G_N_ELEMENTS (priv->nid.szTip) - 1] = 0; + g_free (wcs); + } + if (!Shell_NotifyIconW (NIM_ADD, &priv->nid)) { g_warning (G_STRLOC ": Shell_NotifyIcon(NIM_ADD) failed");