From 25dba9e593a0b7e13be8cec15efe71c8d43c361f Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 13 Mar 2002 19:55:01 +0000 Subject: [PATCH] Rev 1.189 [r1517] of this file introduced a bug. While it is correct to avoid calling term_out() during a drag-select, it's false to assume that all drags are selects - some are xterm mouse-reported drags, and term_out absolutely _should_ be called in those so that the application can show the dragged object moving. Should now be fixed. git-svn-id: svn://svn.tartarus.org/sgt/putty@1590 cda61777-01e9-0310-a592-d414129be87e --- window.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/window.c b/window.c index 66067100..eacddd8f 100644 --- a/window.c +++ b/window.c @@ -728,7 +728,8 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) timer_id = 0; } HideCaret(hwnd); - if (GetCapture() != hwnd) + if (GetCapture() != hwnd || + (send_raw_mouse && !(cfg.mouse_override && is_shift_pressed()))) term_out(); term_update(); ShowCaret(hwnd); @@ -1521,6 +1522,17 @@ static int is_alt_pressed(void) return FALSE; } +static int is_shift_pressed(void) +{ + BYTE keystate[256]; + int r = GetKeyboardState(keystate); + if (!r) + return FALSE; + if (keystate[VK_SHIFT] & 0x80) + return TRUE; + return FALSE; +} + static int resizing; static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, @@ -1535,7 +1547,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, case WM_TIMER: if (pending_netevent) enact_pending_netevent(); - if (GetCapture() != hwnd) + if (GetCapture() != hwnd || + (send_raw_mouse && !(cfg.mouse_override && is_shift_pressed()))) term_out(); noise_regular(); HideCaret(hwnd); -- 2.11.0