فهرست منبع

when desktop has focus center over the screen with the mouse cursor

Scott Brogden 7 سال پیش
والد
کامیت
44e4553331
4فایلهای تغییر یافته به همراه18 افزوده شده و 3 حذف شده
  1. 3 2
      DittoSetup/BuildDitto.bld
  2. 10 0
      ExternalWindowTracker.cpp
  3. 2 0
      ExternalWindowTracker.h
  4. 3 1
      QuickPaste.cpp

+ 3 - 2
DittoSetup/BuildDitto.bld

@@ -177,6 +177,7 @@ End If
 			<ProdVer type='11'>-1</ProdVer>
 			<Version>%version%</Version>
 			<VersionSel type='3'>2</VersionSel>
+			<checked type='11'>0</checked>
 			<indent type='3'>2</indent>
 			<name>Build Ditto 64</name>
 		</step>
@@ -2910,7 +2911,7 @@ var sc_security="b3f57099";
 		</step>
 		<step action='Git'>
 			<Command>log</Command>
-			<Options>--pretty=format:"%%ad %%s" --date=short   --since=2018-01-01</Options>
+			<Options>--pretty=format:"%%ad %%s" --date=short   --since=2018-09-04</Options>
 			<WorkDir>%workDir%</WorkDir>
 			<buildfailsteps type='11'>0</buildfailsteps>
 			<indent type='3'>2</indent>
@@ -3029,7 +3030,7 @@ var sc_security="b3f57099";
 			<value>3</value>
 		</macro>
 		<macro name='verMinor'>
-			<value>21</value>
+			<value>22</value>
 		</macro>
 		<macro name='verRevision'>
 			<value>0</value>

+ 10 - 0
ExternalWindowTracker.cpp

@@ -11,6 +11,7 @@ ExternalWindowTracker::ExternalWindowTracker(void)
 	m_activeWnd = NULL;
 	m_focusWnd = NULL;
 	m_dittoHasFocus = false;
+	m_desktopHasFocus = false;
 }
 
 ExternalWindowTracker::~ExternalWindowTracker(void)
@@ -25,6 +26,7 @@ bool ExternalWindowTracker::TrackActiveWnd(bool force)
 		return false;
 	}
 
+	m_desktopHasFocus = false;
 	BOOL fromHook = true;
 	HWND newFocus = NULL;
 	HWND newActive = ::GetForegroundWindow();
@@ -80,6 +82,14 @@ bool ExternalWindowTracker::TrackActiveWnd(bool force)
 		return false;
 	}
 
+	TCHAR cName[MAX_PATH];
+	GetClassName(newActive, cName, _countof(cName));
+	CString className(cName);
+	if (className == _T("Progman"))
+	{
+		m_desktopHasFocus = true;
+	}
+
 	m_focusWnd = newFocus;
 	m_activeWnd = newActive;
 	m_dittoHasFocus = false;

+ 2 - 0
ExternalWindowTracker.h

@@ -11,6 +11,7 @@ public:
 	HWND ActiveWnd() const { return m_activeWnd; }
 	HWND FocusWnd() const { return m_focusWnd; }
 	bool DittoHasFocus() const { return m_dittoHasFocus; }
+	bool DesktopHasFocus() const { return m_desktopHasFocus; }
 
 	CString ActiveWndName();
 	CString WndName(HWND hWnd);
@@ -29,6 +30,7 @@ protected:
 	HWND m_activeWnd;
 	HWND m_focusWnd;
 	bool m_dittoHasFocus;
+	bool m_desktopHasFocus;
 	
 protected:
 	bool WaitForActiveWnd(HWND hwndToHaveFocus, int timeout);

+ 3 - 1
QuickPaste.cpp

@@ -143,7 +143,9 @@ void CQuickPaste::ShowQPasteWnd(CWnd *pParent, bool bAtPrevPos, bool bFromKeyboa
 		CRect cr;
 		::GetWindowRect(theApp.m_activeWnd.ActiveWnd(), cr);
 		
-		if(cr.Width() > 0 && cr.Height() > 0)
+		if(theApp.m_activeWnd.DesktopHasFocus() == false &&
+			cr.Width() > 0 && 
+			cr.Height() > 0)
 		{
 			ptCaret = cr.CenterPoint();
 			ptCaret.x -= csSize.cx/2;