changeset 6561:33ceba0dfd9b

[gaim-migrate @ 7083] Fix for bug #792641 - Windows hooks tie up committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Thu, 21 Aug 2003 18:29:48 +0000
parents aeb5ee62debc
children c53a3f0649eb
files src/win32/IdleTracker/idletrack.c
diffstat 1 files changed, 16 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/src/win32/IdleTracker/idletrack.c	Thu Aug 21 18:20:05 2003 +0000
+++ b/src/win32/IdleTracker/idletrack.c	Thu Aug 21 18:29:48 2003 +0000
@@ -59,36 +59,31 @@
 
 
 LRESULT CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam) {
-	if (code < 0)
-		return CallNextHookEx(keyHook, code, wParam, lParam);
-	if (lastTime == NULL)
-		lastTime = setup_shared_mem();
+	if (!(code < 0)) {
+                if (lastTime == NULL)
+                        lastTime = setup_shared_mem();
 	
-	if (lastTime)
-		*lastTime = GetTickCount();
-	
+                if (lastTime)
+                        *lastTime = GetTickCount();
+        }
 	return CallNextHookEx(keyHook, code, wParam, lParam);
 }
 
 
 LRESULT CALLBACK MouseProc(int code, WPARAM wParam, LPARAM lParam) {
-	if (code < 0)
-		return CallNextHookEx(mouseHook, code, wParam, lParam);
-
 	/* We need to verify that the Mouse pointer has actually moved. */
-	if((g_point.x == ((MOUSEHOOKSTRUCT*)lParam)->pt.x) &&
-	   (g_point.y == ((MOUSEHOOKSTRUCT*)lParam)->pt.y))
-		return 0;
-
-	g_point.x = ((MOUSEHOOKSTRUCT*)lParam)->pt.x;
-	g_point.y = ((MOUSEHOOKSTRUCT*)lParam)->pt.y;
+	if(!(code < 0) && 
+           !((g_point.x == ((MOUSEHOOKSTRUCT*)lParam)->pt.x) &&
+             (g_point.y == ((MOUSEHOOKSTRUCT*)lParam)->pt.y))) {
+                g_point.x = ((MOUSEHOOKSTRUCT*)lParam)->pt.x;
+                g_point.y = ((MOUSEHOOKSTRUCT*)lParam)->pt.y;
 	
-	if (lastTime == NULL)
-		lastTime = setup_shared_mem();
+                if (lastTime == NULL)
+                        lastTime = setup_shared_mem();
 	
-	if (lastTime)
-		*lastTime = GetTickCount();
-	
+                if (lastTime)
+                        *lastTime = GetTickCount();
+	}
 	return CallNextHookEx(mouseHook, code, wParam, lParam);
 }