src/popupwin.c
void
popup_drag(win_T *wp)
{
    // The popup may be closed before dragging stops.
    if (!win_valid_popup(wp))
	return;

    if ((wp->w_popup_flags & POPF_RESIZE) && drag_on_resize_handle)
    {
	int width_inc = mouse_col - drag_start_col;
	int height_inc = mouse_row - drag_start_row;

	if (width_inc != 0)
	{
	    int width = wp->w_width + width_inc;

	    if (width < 1)
		width = 1;
	    wp->w_minwidth = width;
	    wp->w_maxwidth = width;
	    drag_start_col = mouse_col;
	}

	if (height_inc != 0)
	{
	    int height = wp->w_height + height_inc;

	    if (height < 1)
		height = 1;
	    wp->w_minheight = height;
	    wp->w_maxheight = height;
	    drag_start_row = mouse_row;
	}

	popup_adjust_position(wp);
	return;
    }

    if (!(wp->w_popup_flags & POPF_DRAG))
	return;
    wp->w_wantline = drag_start_wantline + (mouse_row - drag_start_row);
    if (wp->w_wantline < 1)
	wp->w_wantline = 1;
    if (wp->w_wantline > Rows)
	wp->w_wantline = Rows;
    wp->w_wantcol = drag_start_wantcol + (mouse_col - drag_start_col);
    if (wp->w_wantcol < 1)
	wp->w_wantcol = 1;
    if (wp->w_wantcol > Columns)
	wp->w_wantcol = Columns;

    popup_adjust_position(wp);
}
/*
 * Mouse moved while dragging a popup window: adjust the window popup position
 * or resize.
 */
Mouse moved while dragging a popup window: adjust the window popup position
or resize.
Mouse moved while dragging a popup window : adjust the window popup position or resize .
void
popup_drag(win_T *wp)
{
    if (!win_valid_popup(wp))
	return;
    if ((wp->w_popup_flags & POPF_RESIZE) && drag_on_resize_handle)
    {
	int width_inc = mouse_col - drag_start_col;
	int height_inc = mouse_row - drag_start_row;
	if (width_inc != 0)
	{
	    int width = wp->w_width + width_inc;
	    if (width < 1)
		width = 1;
	    wp->w_minwidth = width;
	    wp->w_maxwidth = width;
	    drag_start_col = mouse_col;
	}
	if (height_inc != 0)
	{
	    int height = wp->w_height + height_inc;
	    if (height < 1)
		height = 1;
	    wp->w_minheight = height;
	    wp->w_maxheight = height;
	    drag_start_row = mouse_row;
	}
	popup_adjust_position(wp);
	return;
    }
    if (!(wp->w_popup_flags & POPF_DRAG))
	return;
    wp->w_wantline = drag_start_wantline + (mouse_row - drag_start_row);
    if (wp->w_wantline < 1)
	wp->w_wantline = 1;
    if (wp->w_wantline > Rows)
	wp->w_wantline = Rows;
    wp->w_wantcol = drag_start_wantcol + (mouse_col - drag_start_col);
    if (wp->w_wantcol < 1)
	wp->w_wantcol = 1;
    if (wp->w_wantcol > Columns)
	wp->w_wantcol = Columns;
    popup_adjust_position(wp);
}
void popup_drag ( win_T * wp ) { if ( ! win_valid_popup ( wp ) ) return ; if ( ( wp -> w_popup_flags & POPF_RESIZE ) && drag_on_resize_handle ) { int width_inc = mouse_col - drag_start_col ; int height_inc = mouse_row - drag_start_row ; if ( width_inc != 0 ) { int width = wp -> w_width + width_inc ; if ( width < 1 ) width = 1 ; wp -> w_minwidth = width ; wp -> w_maxwidth = width ; drag_start_col = mouse_col ; } if ( height_inc != 0 ) { int height = wp -> w_height + height_inc ; if ( height < 1 ) height = 1 ; wp -> w_minheight = height ; wp -> w_maxheight = height ; drag_start_row = mouse_row ; } popup_adjust_position ( wp ) ; return ; } if ( ! ( wp -> w_popup_flags & POPF_DRAG ) ) return ; wp -> w_wantline = drag_start_wantline + ( mouse_row - drag_start_row ) ; if ( wp -> w_wantline < 1 ) wp -> w_wantline = 1 ; if ( wp -> w_wantline > Rows ) wp -> w_wantline = Rows ; wp -> w_wantcol = drag_start_wantcol + ( mouse_col - drag_start_col ) ; if ( wp -> w_wantcol < 1 ) wp -> w_wantcol = 1 ; if ( wp -> w_wantcol > Columns ) wp -> w_wantcol = Columns ; popup_adjust_position ( wp ) ; }
Mouse moved while dragging a popup window: adjust the window popup position
 or resize.
Mouse moved while dragging a popup window : adjust the window popup position or resize .
// The popup may be closed before dragging stops.