X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/f0fccd51c27b5cbe8990e625a7bdcf9972142d1f..dc08d858e78fc5c55c4bb1975b5df4b2db12d869:/window.c diff --git a/window.c b/window.c index 71f30b4d..1c724e2f 100644 --- a/window.c +++ b/window.c @@ -611,7 +611,8 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) char *realhost; error = back->init(NULL, &backhandle, &cfg, - cfg.host, cfg.port, &realhost, cfg.tcp_nodelay); + cfg.host, cfg.port, &realhost, cfg.tcp_nodelay, + cfg.tcp_keepalives); back->provide_logctx(backhandle, logctx); if (error) { char *str = dupprintf("%s Error", appname); @@ -1720,6 +1721,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, static int ignore_clip = FALSE; static int need_backend_resize = FALSE; static int fullscr_on_max = FALSE; + static UINT last_mousemove = 0; switch (message) { case WM_TIMER: @@ -2159,7 +2161,21 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, } return 0; case WM_MOUSEMOVE: - show_mouseptr(1); + { + /* + * Windows seems to like to occasionally send MOUSEMOVE + * events even if the mouse hasn't moved. Don't unhide + * the mouse pointer in this case. + */ + static WPARAM wp = 0; + static LPARAM lp = 0; + if (wParam != wp || lParam != lp || + last_mousemove != WM_MOUSEMOVE) { + show_mouseptr(1); + wp = wParam; lp = lParam; + last_mousemove = WM_MOUSEMOVE; + } + } /* * Add the mouse position and message time to the random * number noise. @@ -2182,7 +2198,16 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, } return 0; case WM_NCMOUSEMOVE: - show_mouseptr(1); + { + static WPARAM wp = 0; + static LPARAM lp = 0; + if (wParam != wp || lParam != lp || + last_mousemove != WM_NCMOUSEMOVE) { + show_mouseptr(1); + wp = wParam; lp = lParam; + last_mousemove = WM_NCMOUSEMOVE; + } + } noise_ultralight(lParam); break; case WM_IGNORE_CLIP: