patch 8.2.3697: cannot drag a popup without a border
Problem: Cannot drag a popup without a border.
Solution: Add the "dragall" option. (closes #9218)
diff --git a/src/popupwin.c b/src/popupwin.c
index 0ff26e1..4b8b741 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -297,7 +297,7 @@
return;
}
- if (!(wp->w_popup_flags & POPF_DRAG))
+ if (!(wp->w_popup_flags & (POPF_DRAG | POPF_DRAGALL)))
return;
wp->w_wantline = drag_start_wantline + (mouse_row - drag_start_row);
if (wp->w_wantline < 1)
@@ -687,6 +687,14 @@
else
wp->w_popup_flags &= ~POPF_DRAG;
}
+ nr = dict_get_bool(dict, (char_u *)"dragall", -1);
+ if (nr != -1)
+ {
+ if (nr)
+ wp->w_popup_flags |= POPF_DRAGALL;
+ else
+ wp->w_popup_flags &= ~POPF_DRAGALL;
+ }
nr = dict_get_bool(dict, (char_u *)"posinvert", -1);
if (nr != -1)
@@ -2358,7 +2366,7 @@
int row = mouse_row;
int col = mouse_col;
- if ((wp->w_popup_flags & POPF_DRAG)
+ if ((wp->w_popup_flags & (POPF_DRAG | POPF_DRAGALL))
&& is_mouse_key(c)
&& (wp == popup_dragwin
|| wp == mouse_find_win(&row, &col, FIND_POPUP)))
@@ -3078,6 +3086,8 @@
dict_add_string(dict, "title", wp->w_popup_title);
dict_add_number(dict, "wrap", wp->w_p_wrap);
dict_add_number(dict, "drag", (wp->w_popup_flags & POPF_DRAG) != 0);
+ dict_add_number(dict, "dragall",
+ (wp->w_popup_flags & POPF_DRAGALL) != 0);
dict_add_number(dict, "mapping",
(wp->w_popup_flags & POPF_MAPPING) != 0);
dict_add_number(dict, "resize", (wp->w_popup_flags & POPF_RESIZE) != 0);