summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristopher Plewright <chris@createng.com>2022-10-19 11:54:46 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-19 11:54:46 +0100
commit605d02a9b73cb49ac5022a127db3eac7e16a5d83 (patch)
tree9a2a0e646404bc6159a06e36ffef86a1ba626838 /src
parentbf72e0c67f26ea7c8fd941fdd1533c24c7b6cb43 (diff)
patch 9.0.0793: MS-Windows: mouse scroll events only work with the dllv9.0.0793
Problem: MS-Windows: mouse scroll events only work with the dll. Solution: Accept CSI codes for MS-Windows without the GUI. (Christopher Plewright, closes #11401)
Diffstat (limited to 'src')
-rw-r--r--src/getchar.c6
-rw-r--r--src/os_win32.c18
-rw-r--r--src/version.c2
3 files changed, 13 insertions, 13 deletions
diff --git a/src/getchar.c b/src/getchar.c
index 1ed2fbf1a2..bbc6d6ec29 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -1745,8 +1745,10 @@ vgetc(void)
// Get two extra bytes for special keys
if (c == K_SPECIAL
-#ifdef FEAT_GUI
- || (c == CSI)
+#if defined(FEAT_GUI) || defined(MSWIN)
+ // GUI codes start with CSI; MS-Windows sends mouse scroll
+ // events with CSI.
+ || c == CSI
#endif
)
{
diff --git a/src/os_win32.c b/src/os_win32.c
index 5c845c638e..03b3ac0371 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -1231,7 +1231,6 @@ mch_bevalterm_changed(void)
}
# endif
-#ifdef VIMDLL
/*
* Win32 console mouse scroll event handler.
* Loosely based on the _OnMouseWheel() function in gui_w32.c
@@ -1264,10 +1263,8 @@ decode_mouse_wheel(MOUSE_EVENT_RECORD *pmer)
g_yMouse = pmer->dwMousePosition.Y;
#ifdef FEAT_PROP_POPUP
- int lcol;
- int lrow;
- lcol = g_xMouse;
- lrow = g_yMouse;
+ int lcol = g_xMouse;
+ int lrow = g_yMouse;
wp = mouse_find_win(&lrow, &lcol, FAIL_POPUP);
if (wp != NULL && popup_is_popup(wp))
{
@@ -1312,9 +1309,9 @@ decode_mouse_wheel(MOUSE_EVENT_RECORD *pmer)
// Decode the win32 console key modifers into Vim mouse modifers.
if (pmer->dwControlKeyState & SHIFT_PRESSED)
- modifiers |= MOD_MASK_SHIFT; //MOUSE_SHIFT;
+ modifiers |= MOD_MASK_SHIFT; // MOUSE_SHIFT;
if (pmer->dwControlKeyState & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED))
- modifiers |= MOD_MASK_CTRL; //MOUSE_CTRL;
+ modifiers |= MOD_MASK_CTRL; // MOUSE_CTRL;
if (pmer->dwControlKeyState & (RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED))
modifiers |= MOD_MASK_ALT; // MOUSE_ALT;
@@ -1324,7 +1321,6 @@ decode_mouse_wheel(MOUSE_EVENT_RECORD *pmer)
return;
}
-#endif
/*
* Decode a MOUSE_EVENT. If it's a valid event, return MOUSE_LEFT,
@@ -1395,17 +1391,17 @@ decode_mouse_event(
return FALSE;
}
- // unprocessed mouse click?
+ // If there is an unprocessed mouse click drop this one.
if (g_nMouseClick != -1)
return TRUE;
-#ifdef VIMDLL
+
if (pmer->dwEventFlags == MOUSE_WHEELED
|| pmer->dwEventFlags == MOUSE_HWHEELED)
{
decode_mouse_wheel(pmer);
return TRUE; // we now should have a mouse scroll in g_nMouseClick
}
-#endif
+
nButton = -1;
g_xMouse = pmer->dwMousePosition.X;
g_yMouse = pmer->dwMousePosition.Y;
diff --git a/src/version.c b/src/version.c
index 8111f85049..6d9d87c49e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 793,
+/**/
792,
/**/
791,