diff -r a3530106314b -r d40f49d45614 GUI/GadgetWindow.cs --- a/GUI/GadgetWindow.cs Tue Sep 07 18:40:00 2010 +0000 +++ b/GUI/GadgetWindow.cs Tue Sep 07 18:51:42 2010 +0000 @@ -226,10 +226,13 @@ NativeMethods.SetWindowPos(Handle, IntPtr.Zero, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER | (value ? SWP_SHOWWINDOW : SWP_HIDEWINDOW)); - if (value) - ShowDesktop.Instance.ShowDesktopChanged += ShowDesktopChanged; - else - ShowDesktop.Instance.ShowDesktopChanged -= ShowDesktopChanged; + if (value) { + if (!alwaysOnTop) + ShowDesktop.Instance.ShowDesktopChanged += ShowDesktopChanged; + } else { + if (!alwaysOnTop) + ShowDesktop.Instance.ShowDesktopChanged -= ShowDesktopChanged; + } } } } @@ -252,11 +255,13 @@ if (value != alwaysOnTop) { alwaysOnTop = value; if (alwaysOnTop) { - ShowDesktop.Instance.ShowDesktopChanged -= ShowDesktopChanged; + if (visible) + ShowDesktop.Instance.ShowDesktopChanged -= ShowDesktopChanged; MoveToTopMost(Handle); } else { MoveToBottom(Handle); - ShowDesktop.Instance.ShowDesktopChanged += ShowDesktopChanged; + if (visible) + ShowDesktop.Instance.ShowDesktopChanged += ShowDesktopChanged; } } }