4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: GTK GUI: When the completion popup menu is used scrolling another
12 window by the scrollbar is OK, but using the scroll wheel it
14 Solution: Ignore K_MOUSEDOWN and K_MOUSEUP. Fix redrawing the popup menu.
15 Files: src/edit.c, src/gui.c
18 *** ../vim-7.1.148/src/edit.c Fri Oct 19 20:39:56 2007
19 --- src/edit.c Sun Nov 4 16:17:42 2007
22 if (c != Ctrl_R && vim_is_ctrl_x_key(c))
23 edit_submode_extra = NULL;
25 ! /* Ignore end of Select mode mapping */
29 /* Set "compl_get_longest" when finding the first matches. */
31 if (c != Ctrl_R && vim_is_ctrl_x_key(c))
32 edit_submode_extra = NULL;
34 ! /* Ignore end of Select mode mapping and mouse scroll buttons. */
35 ! if (c == K_SELECT || c == K_MOUSEDOWN || c == K_MOUSEUP)
38 /* Set "compl_get_longest" when finding the first matches. */
44 ! # if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
48 tpos = curwin->w_cursor;
50 # if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
51 - old_curwin = curwin;
53 /* Currently the mouse coordinates are only known in the GUI. */
54 if (gui.in_use && mouse_row >= 0 && mouse_col >= 0)
60 ! # if defined(FEAT_WINDOWS)
61 ! win_T *old_curwin = curwin;
63 ! # ifdef FEAT_INS_EXPAND
64 ! int did_scroll = FALSE;
67 tpos = curwin->w_cursor;
69 # if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
70 /* Currently the mouse coordinates are only known in the GUI. */
71 if (gui.in_use && mouse_row >= 0 && mouse_col >= 0)
78 ! if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
79 ! scroll_redraw(up, (long)(curwin->w_botline - curwin->w_topline));
81 ! scroll_redraw(up, 3L);
83 # if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
84 curwin->w_redr_status = TRUE;
87 curbuf = curwin->w_buffer;
90 if (!equalpos(curwin->w_cursor, tpos))
95 ! # ifdef FEAT_INS_EXPAND
96 ! /* Don't scroll the window in which completion is being done. */
98 ! # if defined(FEAT_WINDOWS)
99 ! || curwin != old_curwin
104 ! if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
105 ! scroll_redraw(up, (long)(curwin->w_botline - curwin->w_topline));
107 ! scroll_redraw(up, 3L);
108 ! # ifdef FEAT_INS_EXPAND
113 # if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
114 curwin->w_redr_status = TRUE;
117 curbuf = curwin->w_buffer;
120 + # ifdef FEAT_INS_EXPAND
121 + /* The popup menu may overlay the window, need to redraw it.
122 + * TODO: Would be more efficient to only redraw the windows that are
123 + * overlapped by the popup menu. */
124 + if (pum_visible() && did_scroll)
126 + redraw_all_later(NOT_VALID);
127 + ins_compl_show_pum();
131 if (!equalpos(curwin->w_cursor, tpos))
132 *** ../vim-7.1.148/src/gui.c Wed Sep 5 21:45:54 2007
133 --- src/gui.c Fri Oct 19 16:14:57 2007
139 ! redraw_win_later(wp, VALID);
140 updateWindow(wp); /* update window, status line, and cmdline */
149 ! #ifdef FEAT_INS_EXPAND
153 ! wp->w_lines_valid = 0;
156 ! /* Don't set must_redraw here, it may cause the popup menu to
157 ! * disappear when losing focus after a scrollbar drag. */
158 ! if (wp->w_redr_type < type)
159 ! wp->w_redr_type = type;
160 updateWindow(wp); /* update window, status line, and cmdline */
163 *** ../vim-7.1.148/src/version.c Sun Nov 4 15:35:23 2007
164 --- src/version.c Tue Nov 6 22:21:03 2007
168 { /* Add new patch number below this line */
174 From "know your smileys":
177 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
178 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
179 \\\ download, build and distribute -- http://www.A-A-P.org ///
180 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///