diff -r 881aedb94bc6 -r 07a9329cd87c GUI/GadgetWindow.cs --- a/GUI/GadgetWindow.cs Sat Nov 13 20:20:03 2010 +0000 +++ b/GUI/GadgetWindow.cs Tue Nov 16 21:48:26 2010 +0000 @@ -152,7 +152,8 @@ if (!lockPositionAndSize) { // prevent the window from leaving the screen if ((wp.flags & SWP_NOMOVE) == 0) { - Rectangle rect = Screen.GetWorkingArea(new Point(wp.x, wp.y)); + Rectangle rect = Screen.GetWorkingArea( + new Rectangle(wp.x, wp.y, wp.cx, wp.cy)); const int margin = 16; wp.x = Math.Max(wp.x, rect.Left - wp.cx + margin); wp.x = Math.Min(wp.x, rect.Right - margin); @@ -194,7 +195,11 @@ } // do not forward any move or size messages - wp.flags |= SWP_NOSIZE | SWP_NOMOVE; + wp.flags |= SWP_NOSIZE | SWP_NOMOVE; + + // suppress any frame changed events + wp.flags &= ~SWP_FRAMECHANGED; + Marshal.StructureToPtr(wp, message.LParam, false); message.Result = IntPtr.Zero; } break; @@ -383,6 +388,7 @@ public const uint SWP_NOSIZE = 0x0001; public const uint SWP_NOMOVE = 0x0002; public const uint SWP_NOACTIVATE = 0x0010; + public const uint SWP_FRAMECHANGED = 0x0020; public const uint SWP_HIDEWINDOW = 0x0080; public const uint SWP_SHOWWINDOW = 0x0040; public const uint SWP_NOZORDER = 0x0004;