1
0
forked from aniani/vim

patch 8.1.1920: cannot always close a popup when filter consumes all events

Problem:    Cannot close a popup by the X when a filter consumes all events.
Solution:   Check for a click on the close button before invoking filters.
            (closes #4858)
This commit is contained in:
Bram Moolenaar
2019-08-24 19:36:00 +02:00
parent 4645104be4
commit f63962378d
7 changed files with 65 additions and 10 deletions

View File

@@ -3070,7 +3070,8 @@ retnomove:
if (row < 0 || col < 0) // check if it makes sense
return IN_UNKNOWN;
// find the window where the row is in
// find the window where the row is in and adjust "row" and "col" to be
// relative to top-left of the window
wp = mouse_find_win(&row, &col, FIND_POPUP);
if (wp == NULL)
return IN_UNKNOWN;
@@ -3083,11 +3084,8 @@ retnomove:
{
on_sep_line = 0;
in_popup_win = TRUE;
if (wp->w_popup_close == POPCLOSE_BUTTON
&& which_button == MOUSE_LEFT
&& popup_on_X_button(wp, row, col))
if (which_button == MOUSE_LEFT && popup_close_if_on_X(wp, row, col))
{
popup_close_for_mouse_click(wp);
return IN_UNKNOWN;
}
else if ((wp->w_popup_flags & (POPF_DRAG | POPF_RESIZE))