From 0d40ebe346182204fcc7d374159f4f4b0e1ca152 Mon Sep 17 00:00:00 2001 From: RKrom Date: Fri, 21 Sep 2012 11:52:35 +0000 Subject: [PATCH] Fixes for Bug #3569703 git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2077 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- Greenshot/Helpers/CaptureHelper.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Greenshot/Helpers/CaptureHelper.cs b/Greenshot/Helpers/CaptureHelper.cs index f46251e75..cf68ea91e 100644 --- a/Greenshot/Helpers/CaptureHelper.cs +++ b/Greenshot/Helpers/CaptureHelper.cs @@ -343,6 +343,19 @@ namespace Greenshot.Helpers { if (windowDetailsThread != null) { windowDetailsThread.Join(); } + // Set capture title, fixing bug #3569703 + foreach (WindowDetails window in WindowDetails.GetVisibleWindows()) { + Point estimatedLocation = new Point(RuntimeConfig.LastCapturedRegion.X + (RuntimeConfig.LastCapturedRegion.Width / 2), RuntimeConfig.LastCapturedRegion.Y + (RuntimeConfig.LastCapturedRegion.Height / 2)); + if (window.Contains(estimatedLocation)) { + selectedCaptureWindow = window; + capture.CaptureDetails.Title = selectedCaptureWindow.Text; + break; + } + } + // Move cursor, fixing bug #3569703 + capture.MoveMouseLocation(capture.ScreenBounds.Location.X - capture.Location.X, capture.ScreenBounds.Location.Y - capture.Location.Y); + capture.MoveElements(capture.ScreenBounds.Location.X - capture.Location.X, capture.ScreenBounds.Location.Y - capture.Location.Y); + capture.CaptureDetails.AddMetaData("source", "screen"); HandleCapture(); }