diff options
| author | George Hazan <george.hazan@gmail.com> | 2013-09-28 11:21:32 +0000 | 
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2013-09-28 11:21:32 +0000 | 
| commit | 30bd869d78ea7d67904e6fa46c205e3a8697c6fc (patch) | |
| tree | 361f46f51f495f4b27a1122f1018bb0ff2e8f2f5 /src/core/stdidle | |
| parent | d4c7112ac94d71397957c2bab796167cc91532fd (diff) | |
fix for keyboard idle state interruption 
git-svn-id: http://svn.miranda-ng.org/main/trunk@6256 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core/stdidle')
| -rw-r--r-- | src/core/stdidle/idle.cpp | 22 | 
1 files changed, 3 insertions, 19 deletions
| diff --git a/src/core/stdidle/idle.cpp b/src/core/stdidle/idle.cpp index 15981a872d..3991217fd8 100644 --- a/src/core/stdidle/idle.cpp +++ b/src/core/stdidle/idle.cpp @@ -140,7 +140,6 @@ static const WORD aa_Status[] = {ID_STATUS_AWAY, ID_STATUS_NA, ID_STATUS_OCCUPIE  static IdleObject gIdleObject;
  static HANDLE hIdleEvent;
 -static BOOL (WINAPI * MyGetLastInputInfo)(PLASTINPUTINFO);
  void CALLBACK IdleTimer(HWND hwnd, UINT umsg, UINT_PTR idEvent, DWORD dwTime);
 @@ -186,25 +185,10 @@ static int IdleObject_IsUserIdle(IdleObject * obj)  		return GetTickCount() - dwTick > (obj->minutes * 60 * 1000);
  	}
 -	if (MyGetLastInputInfo != NULL) {
 -		LASTINPUTINFO ii;
 -		ZeroMemory(&ii, sizeof(ii));
 -		ii.cbSize = sizeof(ii);
 -		if (MyGetLastInputInfo(&ii))
 -			return GetTickCount() - ii.dwTime > (obj->minutes * 60 * 1000);
 -	}
 -	else {
 -		POINT pt;
 -		GetCursorPos(&pt);
 -		if (pt.x != obj->mousepos.x || pt.y != obj->mousepos.y) {
 -			obj->mousepos = pt;
 -			obj->mouseidle = 0;
 -		}
 -		else obj->mouseidle += 2;
 +	LASTINPUTINFO ii = { sizeof(ii) };
 +	if ( GetLastInputInfo(&ii))
 +		return GetTickCount() - ii.dwTime > (obj->minutes * 60 * 1000);
 -		if (obj->mouseidle)
 -			return obj->mouseidle * 1000 >= (obj->minutes * 60 * 1000);
 -	}
  	return FALSE;
  }
 | 
