mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-07 23:46:00 +12:00
fixed #226: Getting window & control regions will be async so it won't slow down opening of region capture
This commit is contained in:
parent
6a3db1d925
commit
c5f515f167
|
@ -24,6 +24,7 @@
|
||||||
#endregion License Information (GPL v3)
|
#endregion License Information (GPL v3)
|
||||||
|
|
||||||
using HelpersLib;
|
using HelpersLib;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
|
@ -134,11 +135,16 @@ public override void Prepare()
|
||||||
AreaManager.IncludeControls |= Config.IncludeControls;
|
AreaManager.IncludeControls |= Config.IncludeControls;
|
||||||
|
|
||||||
if (AreaManager.WindowCaptureMode)
|
if (AreaManager.WindowCaptureMode)
|
||||||
|
{
|
||||||
|
IntPtr handle = Handle;
|
||||||
|
|
||||||
|
TaskEx.Run(() =>
|
||||||
{
|
{
|
||||||
WindowsListAdvanced wla = new WindowsListAdvanced();
|
WindowsListAdvanced wla = new WindowsListAdvanced();
|
||||||
wla.IgnoreHandle = Handle;
|
wla.IgnoreHandle = handle;
|
||||||
wla.IncludeChildWindows = AreaManager.IncludeControls;
|
wla.IncludeChildWindows = AreaManager.IncludeControls;
|
||||||
AreaManager.Windows = wla.GetWindowsRectangleList();
|
AreaManager.Windows = wla.GetWindowsRectangleList();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue