From 17fe2472a26f879ef5c781f84e49fda3ae3e9ea0 Mon Sep 17 00:00:00 2001 From: p989 Date: Mon, 20 Jul 2009 16:03:00 +0000 Subject: [PATCH] win32: cursor doesn't get stuck when dragged outside window --- desmume/src/windows/main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 4c81182d1..f3130e9c0 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -226,8 +226,6 @@ volatile BOOL paused = TRUE; volatile BOOL pausedByMinimize = FALSE; u32 glock = 0; -BOOL click = FALSE; - BOOL finished = FALSE; BOOL romloaded = FALSE; @@ -2679,6 +2677,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM s32 x = (s32)((s16)LOWORD(lParam)); s32 y = (s32)((s16)HIWORD(lParam)); GetClientRect(hwnd,&r); + SetCapture(hwnd); int defwidth = video.width, defheight = (video.height+video.screengap); int winwidth = (r.right-r.left), winheight = (r.bottom-r.top); @@ -2720,8 +2719,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM return 0; case WM_LBUTTONUP: - if(click) - ReleaseCapture(); + + ReleaseCapture(); NDS_releaseTouch(); HudClickRelease(&Hud); return 0;