X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/c1da5066e944d7f20997e83b1ddd7341078b342e..d8d6c7e50e1fcf5171ec15f8a3e9bdcd141f0b64:/window.c diff --git a/window.c b/window.c index 5ea24dcf..59901010 100644 --- a/window.c +++ b/window.c @@ -723,7 +723,8 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) timer_id = 0; } HideCaret(hwnd); - term_out(); + if (GetCapture() != hwnd) + term_out(); term_update(); ShowCaret(hwnd); @@ -1517,7 +1518,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, case WM_TIMER: if (pending_netevent) enact_pending_netevent(); - term_out(); + if (GetCapture() != hwnd) + term_out(); noise_regular(); HideCaret(hwnd); term_update(); @@ -1937,7 +1939,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;