Using background thread to retrieve the window details, this should speed up the time until the CaptureForm is shown.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1610 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-01-24 21:53:09 +00:00
parent 73cfc30d49
commit 6ecba18fae
2 changed files with 64 additions and 52 deletions

View file

@ -230,15 +230,17 @@ namespace Greenshot.Forms {
// Iterate over the found windows and check if the current location is inside a window
Point cursorPosition = Cursor.Position;
selectedCaptureWindow = null;
foreach (WindowDetails window in windows) {
if (window.Contains(cursorPosition)) {
// Only go over the children if we are in window mode
if (CaptureMode.Window == captureMode) {
selectedCaptureWindow = window.FindChildUnderPoint(cursorPosition);
} else {
selectedCaptureWindow = window;
lock (windows) {
foreach (WindowDetails window in windows) {
if (window.Contains(cursorPosition)) {
// Only go over the children if we are in window mode
if (CaptureMode.Window == captureMode) {
selectedCaptureWindow = window.FindChildUnderPoint(cursorPosition);
} else {
selectedCaptureWindow = window;
}
break;
}
break;
}
}
if (selectedCaptureWindow != null && !selectedCaptureWindow.Equals(lastWindow)) {