if (config.Location.X == int.MinValue)\r
return;\r
var bounds = new Rectangle(config.Location, config.Size);\r
- if (MainForm.IsVisibleOnAnyScreen(bounds))\r
+ if (MainForm.IsTitleBarOnAnyScreen(bounds.Location))\r
Location = bounds.Location;\r
Height = bounds.Height;\r
}\r
{\r
if (_config.Location.X == int.MinValue)\r
return;\r
- var newBounds = Bounds;\r
- newBounds.Location = _config.Location;\r
- if (IsVisibleOnAnyScreen(newBounds))\r
+ if (IsTitleBarOnAnyScreen(_config.Location))\r
Location = _config.Location;\r
}\r
\r
_sniffer.LogOutputDir = _config.Log.OutputDir;\r
}\r
\r
- public static bool IsVisibleOnAnyScreen(Rectangle rect)\r
+ public static bool IsTitleBarOnAnyScreen(Point location)\r
{\r
- return Screen.AllScreens.Any(screen => screen.WorkingArea.IntersectsWith(rect));\r
+ var rect = new Rectangle(\r
+ new Point(location.X + SystemInformation.IconSize.Width + SystemInformation.HorizontalFocusThickness,\r
+ location.Y), new Size(60, SystemInformation.CaptionHeight));\r
+ return Screen.AllScreens.Any(screen => screen.WorkingArea.Contains(rect));\r
}\r
\r
private void timerMain_Tick(object sender, EventArgs e)\r