diff --git a/main/Forms/frmMain.cs b/main/Forms/frmMain.cs index 19d67ba..45ff914 100644 --- a/main/Forms/frmMain.cs +++ b/main/Forms/frmMain.cs @@ -200,12 +200,13 @@ private void SetLocation() public static List FindDockedTaskBars() { List dockedRects = new List(); + bool hasDockedRects = false; foreach (var tmpScrn in Screen.AllScreens) { + Rectangle rect = new Rectangle(); + if (!tmpScrn.Bounds.Equals(tmpScrn.WorkingArea)) { - Rectangle rect = new Rectangle(); - var leftDockedWidth = Math.Abs((Math.Abs(tmpScrn.Bounds.Left) - Math.Abs(tmpScrn.WorkingArea.Left))); var topDockedHeight = Math.Abs((Math.Abs(tmpScrn.Bounds.Top) - Math.Abs(tmpScrn.WorkingArea.Top))); var rightDockedWidth = ((tmpScrn.Bounds.Width - leftDockedWidth) - tmpScrn.WorkingArea.Width); @@ -216,6 +217,7 @@ public static List FindDockedTaskBars() rect.Y = tmpScrn.Bounds.Top; rect.Width = leftDockedWidth; rect.Height = tmpScrn.Bounds.Height; + hasDockedRects = true; } else if ((rightDockedWidth > 0)) { @@ -223,6 +225,7 @@ public static List FindDockedTaskBars() rect.Y = tmpScrn.Bounds.Top; rect.Width = rightDockedWidth; rect.Height = tmpScrn.Bounds.Height; + hasDockedRects = true; } else if ((topDockedHeight > 0)) { @@ -230,6 +233,7 @@ public static List FindDockedTaskBars() rect.Y = tmpScrn.Bounds.Top; rect.Width = tmpScrn.WorkingArea.Width; rect.Height = topDockedHeight; + hasDockedRects = true; } else if ((bottomDockedHeight > 0)) { @@ -237,17 +241,16 @@ public static List FindDockedTaskBars() rect.Y = tmpScrn.WorkingArea.Bottom; rect.Width = tmpScrn.WorkingArea.Width; rect.Height = bottomDockedHeight; + hasDockedRects = true; } else { // Nothing found! } - - dockedRects.Add(rect); } + dockedRects.Add(rect); } - - if (dockedRects.Count == 0) + if (!hasDockedRects) { // Taskbar is set to "Auto-Hide". } diff --git a/main/client.cs b/main/client.cs index 36903ce..2d50e3d 100644 --- a/main/client.cs +++ b/main/client.cs @@ -24,6 +24,10 @@ static class client static void Main() { +#if DEBUG + while (!Debugger.IsAttached) { System.Threading.Thread.Sleep(1000); } +#endif + // Use existing methods to obtain cursor already imported as to not import any extra functions // Pass as two variables instead of Point due to Point requiring System.Drawing int cursorX = Cursor.Position.X;