mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.1.1652: GUI: popup window doesn't close on mouse movement
Problem: GUI: popup window doesn't close on mouse movement. (Paul Jolly) Solution: Generate mouse-move events when a popup window is visible.
This commit is contained in:
@@ -603,6 +603,11 @@ EXTERN int aucmd_win_used INIT(= FALSE); /* aucmd_win is being used */
|
|||||||
#ifdef FEAT_TEXT_PROP
|
#ifdef FEAT_TEXT_PROP
|
||||||
EXTERN win_T *first_popupwin; // first global popup window
|
EXTERN win_T *first_popupwin; // first global popup window
|
||||||
EXTERN win_T *popup_dragwin INIT(= NULL); // popup window being dragged
|
EXTERN win_T *popup_dragwin INIT(= NULL); // popup window being dragged
|
||||||
|
|
||||||
|
// Set to TRUE if there is any visible popup.
|
||||||
|
EXTERN int popup_visible INIT(= FALSE);
|
||||||
|
|
||||||
|
EXTERN int text_prop_frozen INIT(= 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1680,10 +1685,3 @@ typedef int HINSTANCE;
|
|||||||
EXTERN int ctrl_break_was_pressed INIT(= FALSE);
|
EXTERN int ctrl_break_was_pressed INIT(= FALSE);
|
||||||
EXTERN HINSTANCE g_hinst INIT(= NULL);
|
EXTERN HINSTANCE g_hinst INIT(= NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_TEXT_PROP
|
|
||||||
EXTERN int text_prop_frozen INIT(= 0);
|
|
||||||
|
|
||||||
// Set to TRUE if there is any visible popup.
|
|
||||||
EXTERN int popup_visible INIT(= FALSE);
|
|
||||||
#endif
|
|
||||||
|
32
src/gui.c
32
src/gui.c
@@ -4823,18 +4823,15 @@ gui_focus_change(int in_focus)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called when the mouse moved (but not when dragging).
|
* When mouse moved: apply 'mousefocus'.
|
||||||
|
* Also updates the mouse pointer shape.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
gui_mouse_moved(int x, int y)
|
gui_mouse_focus(int x, int y)
|
||||||
{
|
{
|
||||||
win_T *wp;
|
win_T *wp;
|
||||||
char_u st[8];
|
char_u st[8];
|
||||||
|
|
||||||
/* Ignore this while still starting up. */
|
|
||||||
if (!gui.in_use || gui.starting)
|
|
||||||
return;
|
|
||||||
|
|
||||||
#ifdef FEAT_MOUSESHAPE
|
#ifdef FEAT_MOUSESHAPE
|
||||||
/* Get window pointer, and update mouse shape as well. */
|
/* Get window pointer, and update mouse shape as well. */
|
||||||
wp = xy2win(x, y);
|
wp = xy2win(x, y);
|
||||||
@@ -4893,6 +4890,27 @@ gui_mouse_moved(int x, int y)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Called when the mouse moved (but not when dragging).
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
gui_mouse_moved(int x, int y)
|
||||||
|
{
|
||||||
|
// Ignore this while still starting up.
|
||||||
|
if (!gui.in_use || gui.starting)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// apply 'mousefocus' and pointer shape
|
||||||
|
gui_mouse_focus(x, y);
|
||||||
|
|
||||||
|
#ifdef FEAT_TEXT_PROP
|
||||||
|
if (popup_visible)
|
||||||
|
// Generate a mouse-moved event, so that the popup can perhaps be
|
||||||
|
// closed, just like in the terminal.
|
||||||
|
gui_send_mouse_event(MOUSE_DRAG, x, y, FALSE, 0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called when mouse should be moved to window with focus.
|
* Called when mouse should be moved to window with focus.
|
||||||
*/
|
*/
|
||||||
|
@@ -777,6 +777,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1652,
|
||||||
/**/
|
/**/
|
||||||
1651,
|
1651,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user