Refactored code location of the isGDIAllowed/isDWMAllowed, also changed the timeout for getting the HTML object from a window to 5 Seconds (instead of 1).

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1877 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-05-18 07:36:18 +00:00
commit cac99fbaf3
5 changed files with 54 additions and 52 deletions

View file

@ -694,7 +694,7 @@ namespace Greenshot.Helpers {
windowCaptureMode = WindowCaptureMode.Screen;
// Change to GDI, if allowed
if (conf.isGDIAllowed(process)) {
if (WindowCapture.isGDIAllowed(process)) {
if (!dwmEnabled && isWPF(process)) {
// do not use GDI, as DWM is not enabled and the application uses PresentationFramework.dll -> isWPF
LOG.InfoFormat("Not using GDI for windows of process {0}, as the process uses WPF", process.ProcessName);
@ -705,20 +705,20 @@ namespace Greenshot.Helpers {
// Change to DWM, if enabled and allowed
if (dwmEnabled) {
if (conf.isDWMAllowed(process)) {
if (WindowCapture.isDWMAllowed(process)) {
windowCaptureMode = WindowCaptureMode.Aero;
}
}
} else if (windowCaptureMode == WindowCaptureMode.Aero || windowCaptureMode == WindowCaptureMode.AeroTransparent) {
if (!dwmEnabled || !conf.isDWMAllowed(process)) {
if (!dwmEnabled || !WindowCapture.isDWMAllowed(process)) {
// Take default screen
windowCaptureMode = WindowCaptureMode.Screen;
// Change to GDI, if allowed
if (conf.isGDIAllowed(process)) {
if (WindowCapture.isGDIAllowed(process)) {
windowCaptureMode = WindowCaptureMode.GDI;
}
}
} else if (windowCaptureMode == WindowCaptureMode.GDI && !conf.isGDIAllowed(process)) {
} else if (windowCaptureMode == WindowCaptureMode.GDI && !WindowCapture.isGDIAllowed(process)) {
// GDI not allowed, take screen
windowCaptureMode = WindowCaptureMode.Screen;
}
@ -729,7 +729,7 @@ namespace Greenshot.Helpers {
while (!captureTaken) {
if (windowCaptureMode == WindowCaptureMode.GDI) {
ICapture tmpCapture = null;
if (conf.isGDIAllowed(process)) {
if (WindowCapture.isGDIAllowed(process)) {
tmpCapture = windowToCapture.CaptureWindow(captureForWindow);
}
if (tmpCapture != null) {
@ -741,7 +741,7 @@ namespace Greenshot.Helpers {
}
} else if (windowCaptureMode == WindowCaptureMode.Aero || windowCaptureMode == WindowCaptureMode.AeroTransparent) {
ICapture tmpCapture = null;
if (conf.isDWMAllowed(process)) {
if (WindowCapture.isDWMAllowed(process)) {
tmpCapture = windowToCapture.CaptureDWMWindow(captureForWindow, windowCaptureMode, isAutoMode);
}
if (tmpCapture != null) {