# HG changeset patch # User Herman Bloggs # Date 1061490588 0 # Node ID 33ceba0dfd9bbcb7606a8e22ecd13b13424231e7 # Parent aeb5ee62debcdff43d9822a276eba0f50cdc7927 [gaim-migrate @ 7083] Fix for bug #792641 - Windows hooks tie up committer: Tailor Script diff -r aeb5ee62debc -r 33ceba0dfd9b src/win32/IdleTracker/idletrack.c --- 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); }