From: simon Date: Sat, 29 Dec 2001 14:05:07 +0000 (+0000) Subject: Jordan Russell's patch: only process mouse drags when we have the X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/commitdiff_plain/319bfe5a459b82240e57b11f38c9f7bf2b53b6da Jordan Russell's patch: only process mouse drags when we have the mouse capture, which in turn will only occur if the initial click was in the PuTTY client area. Prevents mouse drag events without an initiating click, and also prevents selection occurring at unexpected moments such as if you move the mouse before releasing the second click after double-clicking the title bar to maximise the window. git-svn-id: svn://svn.tartarus.org/sgt/putty@1515 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/window.c b/window.c index 5ea24dcf..49a7893b 100644 --- a/window.c +++ b/window.c @@ -1937,7 +1937,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, */ noise_ultralight(lParam); - if (wParam & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) { + if (wParam & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON) && + GetCapture() == hwnd) { Mouse_Button b; if (wParam & MK_LBUTTON) b = MBT_LEFT;