mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 14:03:23 -07:00
Some more changes for BUG-2017, this simplified some of the code and adds different logic for Windows 10 apps.
This commit is contained in:
parent
71aa131f78
commit
c0d18c952c
3 changed files with 43 additions and 34 deletions
|
@ -461,9 +461,11 @@ namespace Greenshot.Helpers {
|
|||
return null;
|
||||
}
|
||||
|
||||
Thread getWindowDetailsThread = new Thread(RetrieveWindowDetails);
|
||||
getWindowDetailsThread.Name = "Retrieve window details";
|
||||
getWindowDetailsThread.IsBackground = true;
|
||||
Thread getWindowDetailsThread = new Thread(RetrieveWindowDetails)
|
||||
{
|
||||
Name = "Retrieve window details",
|
||||
IsBackground = true
|
||||
};
|
||||
getWindowDetailsThread.Start();
|
||||
return getWindowDetailsThread;
|
||||
}
|
||||
|
@ -471,21 +473,7 @@ namespace Greenshot.Helpers {
|
|||
private void RetrieveWindowDetails() {
|
||||
LOG.Debug("start RetrieveWindowDetails");
|
||||
// Start Enumeration of "active" windows
|
||||
List<WindowDetails> allWindows = new List<WindowDetails>(WindowDetails.GetMetroApps());
|
||||
allWindows.AddRange(WindowDetails.GetAllWindows());
|
||||
foreach (WindowDetails window in allWindows) {
|
||||
// Window should be visible and not ourselves
|
||||
if (!window.Visible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip empty
|
||||
Rectangle windowRectangle = window.WindowRectangle;
|
||||
Size windowSize = windowRectangle.Size;
|
||||
if (windowSize.Width == 0 || windowSize.Height == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (var window in WindowDetails.GetVisibleWindows()) {
|
||||
// Make sure the details are retrieved once
|
||||
window.FreezeDetails();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue