Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions main/Forms/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,10 @@ private void frmMain_Load(object sender, EventArgs e)
// Sets location of form
private void SetLocation()
{
List<Rectangle> taskbarList = FindDockedTaskBars();
Dictionary<String, Rectangle> taskbarList = FindDockedTaskBars();
Rectangle taskbar = new Rectangle();
Rectangle screen = new Rectangle();

int i = 0;
int locationy;
int locationx;
if (taskbarList.Count != 0)
Expand All @@ -97,9 +96,9 @@ private void SetLocation()
screen.Y = scr.Bounds.Y;
screen.Width = scr.Bounds.Width;
screen.Height = scr.Bounds.Height;
taskbar = taskbarList[i];
taskbarList.TryGetValue(scr.DeviceName, out taskbar);
break;
}
i++;
}

if (taskbar.Contains(mouseClick)) // Click on taskbar
Expand Down Expand Up @@ -168,7 +167,6 @@ private void SetLocation()
screen.Width = scr.Bounds.Width;
screen.Height = scr.Bounds.Height;
}
i++;
}

if (mouseClick.Y > Screen.PrimaryScreen.Bounds.Height - 35)
Expand Down Expand Up @@ -197,9 +195,10 @@ private void SetLocation()
}
}
// Search for active taskbars on screen
public static List<Rectangle> FindDockedTaskBars()
public static Dictionary<String, Rectangle> FindDockedTaskBars()
{
List<Rectangle> dockedRects = new List<Rectangle>();
var dockedRects = new Dictionary<String, Rectangle>();

foreach (var tmpScrn in Screen.AllScreens)
{
if (!tmpScrn.Bounds.Equals(tmpScrn.WorkingArea))
Expand Down Expand Up @@ -243,7 +242,7 @@ public static List<Rectangle> FindDockedTaskBars()
// Nothing found!
}

dockedRects.Add(rect);
dockedRects.Add(tmpScrn.DeviceName, rect);
}
}

Expand Down