[Ttssh2-commit] [6684] Windows 7 etc.

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2017年 4月 12日 (水) 18:00:39 JST


Revision: 6684
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6684
Author:   doda
Date:     2017-04-12 18:00:39 +0900 (Wed, 12 Apr 2017)
Log Message:
-----------
Windows 7 etc.  で連続して通知メッセージを表示しようとした時に、二つ目の通知でバルーンが消える問題を修正。

Windows 7 等では連続してメッセージを表示しようとすると、

1. 一つ目のバルーンが表示される。
2. 一つ目のバルーンの表示イベントが来る
3. 一つ目のバルーンが消えて?、二つ目のバルーンが表示される。
4. 二つ目のバルーンの表示イベントが来る
5. 一つ目のバルーンのタイムアウトイベントが来る
6. 二つ目のバルーンのタイムアウトイベントが来る

という順番でイベントが通知される。
5 のタイムアウトでバルーン&通知アイコンを非表示にしていた為、その時点で
表示中の二つ目のバルーンが一緒に消えていた。

対処として、メッセージの通知数を管理して、タイムアウトでの通知アイコンを
隠すのをすべてのバルーンが消えた時のみに行うようにした。

Modified Paths:
--------------
    trunk/teraterm/ttpcmn/ttcmn.c

-------------- next part --------------
Modified: trunk/teraterm/ttpcmn/ttcmn.c
===================================================================
--- trunk/teraterm/ttpcmn/ttcmn.c	2017-04-12 09:00:30 UTC (rev 6683)
+++ trunk/teraterm/ttpcmn/ttcmn.c	2017-04-12 09:00:39 UTC (rev 6684)
@@ -2383,6 +2383,7 @@
 
 // Notify Icon \x8A֘A
 static NOTIFYICONDATA notify_icon = {0};
+static int NotifyIconShowCount = 0;
 
 void FAR PASCAL CreateNotifyIcon(PComVar cv)
 {
@@ -2404,6 +2405,8 @@
 		cv->NotifyIcon = &notify_icon;
 
 		Shell_NotifyIcon(NIM_ADD, cv->NotifyIcon);
+
+		NotifyIconShowCount = 0;
 	}
 
 	return;
@@ -2414,6 +2417,7 @@
 	if (cv->NotifyIcon) {
 		Shell_NotifyIcon(NIM_DELETE, cv->NotifyIcon);
 		cv->NotifyIcon = NULL;
+		NotifyIconShowCount = 0;
 	}
 
 	return;
@@ -2429,17 +2433,26 @@
 	cv->NotifyIcon->dwState = 0;
 	cv->NotifyIcon->dwStateMask = NIS_HIDDEN;
 	Shell_NotifyIcon(NIM_MODIFY, cv->NotifyIcon);
+	NotifyIconShowCount += 1;
+
 	return;
 }
 
 void FAR PASCAL HideNotifyIcon(PComVar cv)
 {
-	if (cv->NotifyIcon) {
-		cv->NotifyIcon->uFlags = NIF_STATE;
-		cv->NotifyIcon->dwState = NIS_HIDDEN;
-		cv->NotifyIcon->dwStateMask = NIS_HIDDEN;
-		Shell_NotifyIcon(NIM_MODIFY, cv->NotifyIcon);
+	if (NotifyIconShowCount > 1) {
+		NotifyIconShowCount -= 1;
 	}
+	else {
+		if (cv->NotifyIcon) {
+			cv->NotifyIcon->uFlags = NIF_STATE;
+			cv->NotifyIcon->dwState = NIS_HIDDEN;
+			cv->NotifyIcon->dwStateMask = NIS_HIDDEN;
+			Shell_NotifyIcon(NIM_MODIFY, cv->NotifyIcon);
+		}
+		NotifyIconShowCount = 0;
+	}
+
 	return;
 }
 
@@ -2479,6 +2492,8 @@
 
 	Shell_NotifyIcon(NIM_MODIFY, cv->NotifyIcon);
 
+	NotifyIconShowCount += 1;
+
 	return;
 }
 



Ttssh2-commit メーリングリストの案内
Back to archive index