From 73a7832e33708233ce63d6ffcfc104aefed33a8d Mon Sep 17 00:00:00 2001 From: William Waller Date: Sun, 25 Mar 2018 14:12:03 -0500 Subject: [PATCH] Add .vs (Visual Studio caches/settings) to gitignore and attempted fix to RDP system tray issues referenced by issue 1092 --- .gitignore | 3 ++- GUI/NotifyIconAdv.cs | 24 +++++------------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 680f7ae06..395d08fcf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.user *.suo /Bin -/Obj \ No newline at end of file +/Obj +/.vs \ No newline at end of file diff --git a/GUI/NotifyIconAdv.cs b/GUI/NotifyIconAdv.cs index e40782d3f..34f0af63c 100644 --- a/GUI/NotifyIconAdv.cs +++ b/GUI/NotifyIconAdv.cs @@ -525,31 +525,17 @@ private void UpdateNotifyIcon(bool showNotifyIcon) { if (showNotifyIcon && icon != null) { if (!created) { - int i = 0; - do { - created = NativeMethods.Shell_NotifyIcon( - NativeMethods.NotifyIconMessage.Add, data); - if (!created) { - System.Threading.Thread.Sleep(200); - i++; - } - } while (!created && i < 40); + NativeMethods.Shell_NotifyIcon( + NativeMethods.NotifyIconMessage.Add, data); + created = true; } else { NativeMethods.Shell_NotifyIcon( NativeMethods.NotifyIconMessage.Modify, data); } } else { if (created) { - int i = 0; - bool deleted = false; - do { - deleted = NativeMethods.Shell_NotifyIcon( - NativeMethods.NotifyIconMessage.Delete, data); - if (!deleted) { - System.Threading.Thread.Sleep(200); - i++; - } - } while (!deleted && i < 40); + NativeMethods.Shell_NotifyIcon( + NativeMethods.NotifyIconMessage.Delete, data); created = false; } }