comparison src/gui_w32.c @ 18520:6067fbb46625 v8.1.2254

patch 8.1.2254: MS-Windows: mouse scroll wheel doesn't work in popup Commit: https://github.com/vim/vim/commit/0630bb6580237fe01db22a84885c10f12580f7af Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 4 22:52:12 2019 +0100 patch 8.1.2254: MS-Windows: mouse scroll wheel doesn't work in popup Problem: MS-Windows: mouse scroll wheel doesn't work in popup. Solution: Handle mouse wheel events separately. (closes https://github.com/vim/vim/issues/5138)
author Bram Moolenaar <Bram@vim.org>
date Mon, 04 Nov 2019 23:00:04 +0100
parents 59b3d19511d0
children 334b1f897f3a
comparison
equal deleted inserted replaced
18519:66bcf00b61df 18520:6067fbb46625
4260 4260
4261 size = curwin->w_height; 4261 size = curwin->w_height;
4262 if (mouse_scroll_lines == 0) 4262 if (mouse_scroll_lines == 0)
4263 init_mouse_wheel(); 4263 init_mouse_wheel();
4264 4264
4265 #ifdef FEAT_TEXT_PROP
4266 {
4267 win_T *wp = gui_mouse_window(FIND_POPUP);
4268
4269 if (wp != NULL && popup_is_popup(wp))
4270 {
4271 cmdarg_T cap;
4272 oparg_T oa;
4273
4274 // Mouse hovers over popup window, scroll it if possible.
4275 mouse_row = wp->w_winrow;
4276 mouse_col = wp->w_wincol;
4277 vim_memset(&cap, 0, sizeof(cap));
4278 cap.arg = zDelta < 0 ? MSCR_UP : MSCR_DOWN;
4279 cap.cmdchar = zDelta < 0 ? K_MOUSEUP : K_MOUSEDOWN;
4280 clear_oparg(&oa);
4281 cap.oap = &oa;
4282 nv_mousescroll(&cap);
4283 update_screen(0);
4284 setcursor();
4285 out_flush();
4286 return;
4287 }
4288 }
4289 #endif
4290
4265 mch_disable_flush(); 4291 mch_disable_flush();
4266 if (mouse_scroll_lines > 0 4292 if (mouse_scroll_lines > 0
4267 && mouse_scroll_lines < (size > 2 ? size - 2 : 1)) 4293 && mouse_scroll_lines < (size > 2 ? size - 2 : 1))
4268 { 4294 {
4269 for (i = mouse_scroll_lines; i > 0; --i) 4295 for (i = mouse_scroll_lines; i > 0; --i)