src/popupwin.c
void
popup_start_drag(win_T *wp, int row, int col)
{
    drag_start_row = mouse_row;
    drag_start_col = mouse_col;
    if (wp->w_wantline <= 0)
	drag_start_wantline = wp->w_winrow + 1;
    else
	drag_start_wantline = wp->w_wantline;
    if (wp->w_wantcol == 0)
	drag_start_wantcol = wp->w_wincol + 1;
    else
	drag_start_wantcol = wp->w_wantcol;

    // Stop centering the popup
    if (wp->w_popup_pos == POPPOS_CENTER)
	wp->w_popup_pos = POPPOS_TOPLEFT;

    drag_on_resize_handle = wp->w_popup_border[1] > 0
			    && wp->w_popup_border[2] > 0
			    && row == popup_height(wp) - 1
			    && col == popup_width(wp) - 1;

    if (wp->w_popup_pos != POPPOS_TOPLEFT && drag_on_resize_handle)
    {
	if (wp->w_popup_pos == POPPOS_TOPRIGHT
		|| wp->w_popup_pos == POPPOS_BOTRIGHT)
	    wp->w_wantcol = wp->w_wincol + 1;
	if (wp->w_popup_pos == POPPOS_BOTLEFT)
	    wp->w_wantline = wp->w_winrow + 1;
	wp->w_popup_pos = POPPOS_TOPLEFT;
    }
}
/*
 * Mouse down on border of popup window: start dragging it.
 * Uses mouse_col and mouse_row.
 */
Mouse down on border of popup window: start dragging it.
Mouse down on border of popup window : start dragging it .
void
popup_start_drag(win_T *wp, int row, int col)
{
    drag_start_row = mouse_row;
    drag_start_col = mouse_col;
    if (wp->w_wantline <= 0)
	drag_start_wantline = wp->w_winrow + 1;
    else
	drag_start_wantline = wp->w_wantline;
    if (wp->w_wantcol == 0)
	drag_start_wantcol = wp->w_wincol + 1;
    else
	drag_start_wantcol = wp->w_wantcol;
    if (wp->w_popup_pos == POPPOS_CENTER)
	wp->w_popup_pos = POPPOS_TOPLEFT;
    drag_on_resize_handle = wp->w_popup_border[1] > 0
			    && wp->w_popup_border[2] > 0
			    && row == popup_height(wp) - 1
			    && col == popup_width(wp) - 1;
    if (wp->w_popup_pos != POPPOS_TOPLEFT && drag_on_resize_handle)
    {
	if (wp->w_popup_pos == POPPOS_TOPRIGHT
		|| wp->w_popup_pos == POPPOS_BOTRIGHT)
	    wp->w_wantcol = wp->w_wincol + 1;
	if (wp->w_popup_pos == POPPOS_BOTLEFT)
	    wp->w_wantline = wp->w_winrow + 1;
	wp->w_popup_pos = POPPOS_TOPLEFT;
    }
}
void popup_start_drag ( win_T * wp , int row , int col ) { drag_start_row = mouse_row ; drag_start_col = mouse_col ; if ( wp -> w_wantline <= 0 ) drag_start_wantline = wp -> w_winrow + 1 ; else drag_start_wantline = wp -> w_wantline ; if ( wp -> w_wantcol == 0 ) drag_start_wantcol = wp -> w_wincol + 1 ; else drag_start_wantcol = wp -> w_wantcol ; if ( wp -> w_popup_pos == POPPOS_CENTER ) wp -> w_popup_pos = POPPOS_TOPLEFT ; drag_on_resize_handle = wp -> w_popup_border [ 1 ] > 0 && wp -> w_popup_border [ 2 ] > 0 && row == popup_height ( wp ) - 1 && col == popup_width ( wp ) - 1 ; if ( wp -> w_popup_pos != POPPOS_TOPLEFT && drag_on_resize_handle ) { if ( wp -> w_popup_pos == POPPOS_TOPRIGHT || wp -> w_popup_pos == POPPOS_BOTRIGHT ) wp -> w_wantcol = wp -> w_wincol + 1 ; if ( wp -> w_popup_pos == POPPOS_BOTLEFT ) wp -> w_wantline = wp -> w_winrow + 1 ; wp -> w_popup_pos = POPPOS_TOPLEFT ; } }
Mouse down on border of popup window: start dragging it.
Mouse down on border of popup window : start dragging it .
// Stop centering the popup