1.1 --- a/GUI/GadgetWindow.cs Sat Nov 13 20:20:03 2010 +0000
1.2 +++ b/GUI/GadgetWindow.cs Tue Nov 16 21:48:26 2010 +0000
1.3 @@ -152,7 +152,8 @@
1.4 if (!lockPositionAndSize) {
1.5 // prevent the window from leaving the screen
1.6 if ((wp.flags & SWP_NOMOVE) == 0) {
1.7 - Rectangle rect = Screen.GetWorkingArea(new Point(wp.x, wp.y));
1.8 + Rectangle rect = Screen.GetWorkingArea(
1.9 + new Rectangle(wp.x, wp.y, wp.cx, wp.cy));
1.10 const int margin = 16;
1.11 wp.x = Math.Max(wp.x, rect.Left - wp.cx + margin);
1.12 wp.x = Math.Min(wp.x, rect.Right - margin);
1.13 @@ -194,7 +195,11 @@
1.14 }
1.15
1.16 // do not forward any move or size messages
1.17 - wp.flags |= SWP_NOSIZE | SWP_NOMOVE;
1.18 + wp.flags |= SWP_NOSIZE | SWP_NOMOVE;
1.19 +
1.20 + // suppress any frame changed events
1.21 + wp.flags &= ~SWP_FRAMECHANGED;
1.22 +
1.23 Marshal.StructureToPtr(wp, message.LParam, false);
1.24 message.Result = IntPtr.Zero;
1.25 } break;
1.26 @@ -383,6 +388,7 @@
1.27 public const uint SWP_NOSIZE = 0x0001;
1.28 public const uint SWP_NOMOVE = 0x0002;
1.29 public const uint SWP_NOACTIVATE = 0x0010;
1.30 + public const uint SWP_FRAMECHANGED = 0x0020;
1.31 public const uint SWP_HIDEWINDOW = 0x0080;
1.32 public const uint SWP_SHOWWINDOW = 0x0040;
1.33 public const uint SWP_NOZORDER = 0x0004;