Rev 1.189 [r1517] of this file introduced a bug. While it is correct
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 13 Mar 2002 19:55:01 +0000 (19:55 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 13 Mar 2002 19:55:01 +0000 (19:55 +0000)
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

index 6606710..eacddd8 100644 (file)
--- 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);