aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2013-11-25 08:44:20 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2013-11-25 08:44:20 +0000
commitf00de36ea0b8913f6d241c3aa9a08a7270a90450 (patch)
tree6057d1ccc6806a07237fb0af6b02afbf84bf792b /src/main.c
parent2a61a47e23ac122049a098ecab6ffeb3f813f263 (diff)
src/main.c: win32: check for the TaskbarCreated message and reshow icon when explorer.exe crashes.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3297 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 1d2c9c42..d98c25ca 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1144,6 +1144,11 @@ static void set_log_handlers(gboolean enable)
}
#ifdef G_OS_WIN32
+
+#if !GTK_CHECK_VERSION(2, 14, 0)
+static UINT taskbar_created_msg;
+#endif
+
static BOOL WINAPI
ctrl_handler(DWORD dwctrltype)
{
@@ -1176,6 +1181,21 @@ wndproc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
}
break;
default:
+#if !GTK_CHECK_VERSION(2, 14, 0)
+ if (message == taskbar_created_msg) {
+ debug_print("TaskbarCreated received\n");
+
+ /* recreate tray icon */
+ {
+ MainWindow *mainwin = main_window_get();
+ if (mainwin && mainwin->tray_icon &&
+ gtk_status_icon_get_visible(mainwin->tray_icon->status_icon)) {
+ trayicon_hide(mainwin->tray_icon);
+ trayicon_show(mainwin->tray_icon);
+ }
+ }
+ }
+#endif
break;
}
@@ -1200,6 +1220,10 @@ static void register_system_events(void)
if (hwnd)
return;
+#if !GTK_CHECK_VERSION(2, 14, 0)
+ taskbar_created_msg = RegisterWindowMessage("TaskbarCreated");
+#endif
+
debug_print("register_system_events(): RegisterClass\n");
memset(&wclass, 0, sizeof(WNDCLASS));