mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
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:
parent
73cfc30d49
commit
6ecba18fae
2 changed files with 64 additions and 52 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue