diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-03-06 17:09:20 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-03-06 17:09:20 +0100 |
commit | 157d813be41c122e210b0eb1cd1e862fbddbf665 (patch) | |
tree | fec3f8efc523ec6e6ff688cd57f03526c204d66f | |
parent | 3b3a9a5609df2cbaef3512032ac47c1779fbc775 (diff) | |
download | vim-git-157d813be41c122e210b0eb1cd1e862fbddbf665.tar.gz |
patch 8.0.1582: in the MS-Windows console mouse movement is not usedv8.0.1582
Problem: In the MS-Windows console mouse movement is not used.
Solution: Pass mouse movement events when useful.
-rw-r--r-- | src/feature.h | 2 | ||||
-rw-r--r-- | src/os_win32.c | 27 | ||||
-rw-r--r-- | src/proto/os_win32.pro | 1 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 28 insertions, 4 deletions
diff --git a/src/feature.h b/src/feature.h index 772029667..c80dc0511 100644 --- a/src/feature.h +++ b/src/feature.h @@ -1318,7 +1318,7 @@ /* * +balloon_eval_term Allow balloon expression evaluation in the terminal. */ -#if defined(FEAT_HUGE) && defined(UNIX) && defined(FEAT_TIMERS) +#if defined(FEAT_HUGE) && (defined(UNIX) || defined(WIN32)) && defined(FEAT_TIMERS) # define FEAT_BEVAL_TERM #endif diff --git a/src/os_win32.c b/src/os_win32.c index be1c4e0a6..4dc446be2 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -1164,6 +1164,18 @@ mch_setmouse(int on) SetConsoleMode(g_hConIn, cmodein); } + +#if defined(FEAT_BEVAL_TERM) || defined(PROTO) +/* + * Called when 'balloonevalterm' changed. + */ + void +mch_bevalterm_changed(void) +{ + mch_setmouse(g_fMouseActive); +} +#endif + /* * Decode a MOUSE_EVENT. If it's a valid event, return MOUSE_LEFT, * MOUSE_MIDDLE, or MOUSE_RIGHT for a click; MOUSE_DRAG for a mouse @@ -1243,7 +1255,7 @@ decode_mouse_event( if (pmer->dwEventFlags == MOUSE_MOVED) { - /* ignore MOUSE_MOVED events if (x, y) hasn't changed. (We get these + /* Ignore MOUSE_MOVED events if (x, y) hasn't changed. (We get these * events even when the mouse moves only within a char cell.) */ if (s_xOldMouse == g_xMouse && s_yOldMouse == g_yMouse) return FALSE; @@ -1252,11 +1264,20 @@ decode_mouse_event( /* If no buttons are pressed... */ if ((pmer->dwButtonState & ((1 << cButtons) - 1)) == 0) { + nButton = MOUSE_RELEASE; + /* If the last thing returned was MOUSE_RELEASE, ignore this */ if (s_fReleased) - return FALSE; + { +#ifdef FEAT_BEVAL_TERM + /* do return mouse move events when we want them */ + if (p_bevalterm) + nButton = MOUSE_DRAG; + else +#endif + return FALSE; + } - nButton = MOUSE_RELEASE; s_fReleased = TRUE; } else /* one or more buttons pressed */ diff --git a/src/proto/os_win32.pro b/src/proto/os_win32.pro index d76e27020..1bed98aaf 100644 --- a/src/proto/os_win32.pro +++ b/src/proto/os_win32.pro @@ -6,6 +6,7 @@ int dyn_libintl_init(void); void dyn_libintl_end(void); void PlatformId(void); void mch_setmouse(int on); +void mch_bevalterm_changed(void); void mch_update_cursor(void); int mch_char_avail(void); int mch_check_messages(void); diff --git a/src/version.c b/src/version.c index 002adede9..ff708a088 100644 --- a/src/version.c +++ b/src/version.c @@ -767,6 +767,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1582, +/**/ 1581, /**/ 1580, |