]> granicus.if.org Git - vim/commitdiff
patch 8.0.1582: in the MS-Windows console mouse movement is not used v8.0.1582
authorBram Moolenaar <Bram@vim.org>
Tue, 6 Mar 2018 16:09:20 +0000 (17:09 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 6 Mar 2018 16:09:20 +0000 (17:09 +0100)
Problem:    In the MS-Windows console mouse movement is not used.
Solution:   Pass mouse movement events when useful.

src/feature.h
src/os_win32.c
src/proto/os_win32.pro
src/version.c

index 772029667fcd7b2070dac1834b3d3a14560393dd..c80dc05115e12693500303bf15bdc475d7f71f53 100644 (file)
 /*
  * +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
 
index be1c4e0a68d8c4525789858b17e527d7718599b8..4dc446be20cb6e68ad27232f110771f8fb688d78 100644 (file)
@@ -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 */
index d76e27020fd882955b7395019aeafc63ce7c23f5..1bed98aaf535a584dec41c1122cd2afb79147bcd 100644 (file)
@@ -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);
index 002adede93dd4984b8d5678008f901cc67ae0344..ff708a088d0476777992beb556dd53155071c776 100644 (file)
@@ -766,6 +766,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1582,
 /**/
     1581,
 /**/