summaryrefslogtreecommitdiff
path: root/src/gui_w32.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-04 22:52:12 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-04 22:52:12 +0100
commit0630bb6580237fe01db22a84885c10f12580f7af (patch)
tree8dcb3350fa0578364d2e54c50c49dc9cbb5d5c00 /src/gui_w32.c
parentad4de52510d5b4a949c0c9e25b5d5333744820b3 (diff)
downloadvim-git-0630bb6580237fe01db22a84885c10f12580f7af.tar.gz
patch 8.1.2254: MS-Windows: mouse scroll wheel doesn't work in popupv8.1.2254
Problem: MS-Windows: mouse scroll wheel doesn't work in popup. Solution: Handle mouse wheel events separately. (closes #5138)
Diffstat (limited to 'src/gui_w32.c')
-rw-r--r--src/gui_w32.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gui_w32.c b/src/gui_w32.c
index 4ee18634f..3cf782cab 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -4262,6 +4262,32 @@ _OnMouseWheel(
if (mouse_scroll_lines == 0)
init_mouse_wheel();
+#ifdef FEAT_TEXT_PROP
+ {
+ win_T *wp = gui_mouse_window(FIND_POPUP);
+
+ if (wp != NULL && popup_is_popup(wp))
+ {
+ cmdarg_T cap;
+ oparg_T oa;
+
+ // Mouse hovers over popup window, scroll it if possible.
+ mouse_row = wp->w_winrow;
+ mouse_col = wp->w_wincol;
+ vim_memset(&cap, 0, sizeof(cap));
+ cap.arg = zDelta < 0 ? MSCR_UP : MSCR_DOWN;
+ cap.cmdchar = zDelta < 0 ? K_MOUSEUP : K_MOUSEDOWN;
+ clear_oparg(&oa);
+ cap.oap = &oa;
+ nv_mousescroll(&cap);
+ update_screen(0);
+ setcursor();
+ out_flush();
+ return;
+ }
+ }
+#endif
+
mch_disable_flush();
if (mouse_scroll_lines > 0
&& mouse_scroll_lines < (size > 2 ? size - 2 : 1))