Mercurial > vim
comparison src/popupwin.c @ 28187:d27a9eed9849 v8.2.4619
patch 8.2.4619: mapping is cancelled when mouse moves and popup is visible
Commit: https://github.com/vim/vim/commit/f8e43f6107f3a83b8c74a84c4c8f99598e2dc4c0
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 24 15:15:15 2022 +0000
patch 8.2.4619: mapping is cancelled when mouse moves and popup is visible
Problem: Mapping is cancelled when mouse moves and popup is visible.
Solution: Only generate mouse moved events when a popup may use them.
(closes #10004)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 24 Mar 2022 16:30:03 +0100 |
parents | d3adf7b141a9 |
children | 8ef5c996df31 |
comparison
equal
deleted
inserted
replaced
28186:5d3592802fb9 | 28187:d27a9eed9849 |
---|---|
146 set_mousemoved_values(win_T *wp) | 146 set_mousemoved_values(win_T *wp) |
147 { | 147 { |
148 wp->w_popup_mouse_row = mouse_row; | 148 wp->w_popup_mouse_row = mouse_row; |
149 wp->w_popup_mouse_mincol = mouse_col; | 149 wp->w_popup_mouse_mincol = mouse_col; |
150 wp->w_popup_mouse_maxcol = mouse_col; | 150 wp->w_popup_mouse_maxcol = mouse_col; |
151 } | |
152 | |
153 static void | |
154 update_popup_uses_mouse_move(void) | |
155 { | |
156 popup_uses_mouse_move = FALSE; | |
157 if (popup_visible) | |
158 { | |
159 win_T *wp; | |
160 | |
161 FOR_ALL_POPUPWINS(wp) | |
162 if (wp->w_popup_mouse_row != 0) | |
163 { | |
164 popup_uses_mouse_move = TRUE; | |
165 return; | |
166 } | |
167 FOR_ALL_POPUPWINS_IN_TAB(curtab, wp) | |
168 if (wp->w_popup_mouse_row != 0) | |
169 { | |
170 popup_uses_mouse_move = TRUE; | |
171 return; | |
172 } | |
173 } | |
151 } | 174 } |
152 | 175 |
153 /* | 176 /* |
154 * Used when popup options contain "moved" with "word" or "WORD". | 177 * Used when popup options contain "moved" with "word" or "WORD". |
155 */ | 178 */ |
3584 } | 3607 } |
3585 | 3608 |
3586 /* | 3609 /* |
3587 * Update "popup_mask" if needed. | 3610 * Update "popup_mask" if needed. |
3588 * Also recomputes the popup size and positions. | 3611 * Also recomputes the popup size and positions. |
3589 * Also updates "popup_visible". | 3612 * Also updates "popup_visible" and "popup_uses_mouse_move". |
3590 * Also marks window lines for redrawing. | 3613 * Also marks window lines for redrawing. |
3591 */ | 3614 */ |
3592 void | 3615 void |
3593 may_update_popup_mask(int type) | 3616 may_update_popup_mask(int type) |
3594 { | 3617 { |
3753 } | 3776 } |
3754 } | 3777 } |
3755 | 3778 |
3756 vim_free(plines_cache); | 3779 vim_free(plines_cache); |
3757 } | 3780 } |
3781 | |
3782 update_popup_uses_mouse_move(); | |
3758 } | 3783 } |
3759 | 3784 |
3760 /* | 3785 /* |
3761 * If the current window is a popup and something relevant changed, recompute | 3786 * If the current window is a popup and something relevant changed, recompute |
3762 * the position and size. | 3787 * the position and size. |