mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.1.1265: when GPM mouse support is enabled double clicks do not work
Problem: When GPM mouse support is enabled double clicks in xterm do not work. Solution: Use KS_GPM_MOUSE for GPM mouse events.
This commit is contained in:
@@ -114,6 +114,9 @@
|
||||
#define KS_SGR_MOUSE 237
|
||||
#define KS_SGR_MOUSE_RELEASE 236
|
||||
|
||||
/* Used for the GPM mouse. */
|
||||
#define KS_GPM_MOUSE 235
|
||||
|
||||
/*
|
||||
* Filler used after KS_SPECIAL and others
|
||||
*/
|
||||
|
@@ -3794,7 +3794,10 @@ check_mouse_termcode(void)
|
||||
&& !gui.in_use
|
||||
# endif
|
||||
)
|
||||
set_mouse_termcode(KS_MOUSE, (char_u *)IF_EB("\033MG", ESC_STR "MG"));
|
||||
set_mouse_termcode(KS_GPM_MOUSE,
|
||||
(char_u *)IF_EB("\033MG", ESC_STR "MG"));
|
||||
else
|
||||
del_mouse_termcode(KS_GPM_MOUSE);
|
||||
# endif
|
||||
|
||||
# ifdef FEAT_SYSMOUSE
|
||||
@@ -7065,7 +7068,8 @@ gpm_close(void)
|
||||
Gpm_Close();
|
||||
}
|
||||
|
||||
/* Reads gpm event and adds special keys to input buf. Returns length of
|
||||
/*
|
||||
* Reads gpm event and adds special keys to input buf. Returns length of
|
||||
* generated key sequence.
|
||||
* This function is styled after gui_send_mouse_event().
|
||||
*/
|
||||
|
41
src/term.c
41
src/term.c
@@ -4396,9 +4396,6 @@ check_termcode(
|
||||
# endif
|
||||
#endif
|
||||
int cpo_koffset;
|
||||
#ifdef FEAT_MOUSE_GPM
|
||||
extern int gpm_flag; /* gpm library variable */
|
||||
#endif
|
||||
|
||||
cpo_koffset = (vim_strchr(p_cpo, CPO_KOFFSET) != NULL);
|
||||
|
||||
@@ -5122,6 +5119,9 @@ check_termcode(
|
||||
* If it is a mouse click, get the coordinates.
|
||||
*/
|
||||
if (key_name[0] == KS_MOUSE
|
||||
# ifdef FEAT_MOUSE_GPM
|
||||
|| key_name[0] == KS_GPM_MOUSE
|
||||
# endif
|
||||
# ifdef FEAT_MOUSE_JSB
|
||||
|| key_name[0] == KS_JSBTERM_MOUSE
|
||||
# endif
|
||||
@@ -5144,7 +5144,11 @@ check_termcode(
|
||||
|
||||
# if !defined(UNIX) || defined(FEAT_MOUSE_XTERM) || defined(FEAT_GUI) \
|
||||
|| defined(FEAT_MOUSE_GPM) || defined(FEAT_SYSMOUSE)
|
||||
if (key_name[0] == (int)KS_MOUSE)
|
||||
if (key_name[0] == KS_MOUSE
|
||||
# ifdef FEAT_MOUSE_GPM
|
||||
|| key_name[0] == KS_GPM_MOUSE
|
||||
# endif
|
||||
)
|
||||
{
|
||||
/*
|
||||
* For xterm we get "<t_mouse>scr", where
|
||||
@@ -5274,9 +5278,12 @@ check_termcode(
|
||||
modifiers = 0;
|
||||
}
|
||||
|
||||
if (key_name[0] == (int)KS_MOUSE
|
||||
if (key_name[0] == KS_MOUSE
|
||||
# ifdef FEAT_MOUSE_GPM
|
||||
|| key_name[0] == KS_GPM_MOUSE
|
||||
# endif
|
||||
# ifdef FEAT_MOUSE_URXVT
|
||||
|| key_name[0] == (int)KS_URXVT_MOUSE
|
||||
|| key_name[0] == KS_URXVT_MOUSE
|
||||
# endif
|
||||
|| key_name[0] == KS_SGR_MOUSE
|
||||
|| key_name[0] == KS_SGR_MOUSE_RELEASE)
|
||||
@@ -5293,7 +5300,7 @@ check_termcode(
|
||||
&& !gui.in_use
|
||||
# endif
|
||||
# ifdef FEAT_MOUSE_GPM
|
||||
&& gpm_flag == 0
|
||||
&& key_name[0] != KS_GPM_MOUSE
|
||||
# endif
|
||||
)
|
||||
{
|
||||
@@ -5342,7 +5349,7 @@ check_termcode(
|
||||
}
|
||||
# endif /* !UNIX || FEAT_MOUSE_XTERM */
|
||||
# ifdef FEAT_MOUSE_NET
|
||||
if (key_name[0] == (int)KS_NETTERM_MOUSE)
|
||||
if (key_name[0] == KS_NETTERM_MOUSE)
|
||||
{
|
||||
int mc, mr;
|
||||
|
||||
@@ -5365,7 +5372,7 @@ check_termcode(
|
||||
}
|
||||
# endif /* FEAT_MOUSE_NET */
|
||||
# ifdef FEAT_MOUSE_JSB
|
||||
if (key_name[0] == (int)KS_JSBTERM_MOUSE)
|
||||
if (key_name[0] == KS_JSBTERM_MOUSE)
|
||||
{
|
||||
int mult, val, iter, button, status;
|
||||
|
||||
@@ -5489,7 +5496,7 @@ check_termcode(
|
||||
}
|
||||
# endif /* FEAT_MOUSE_JSB */
|
||||
# ifdef FEAT_MOUSE_DEC
|
||||
if (key_name[0] == (int)KS_DEC_MOUSE)
|
||||
if (key_name[0] == KS_DEC_MOUSE)
|
||||
{
|
||||
/* The DEC Locator Input Model
|
||||
* Netterm delivers the code sequence:
|
||||
@@ -5624,7 +5631,7 @@ check_termcode(
|
||||
}
|
||||
# endif /* FEAT_MOUSE_DEC */
|
||||
# ifdef FEAT_MOUSE_PTERM
|
||||
if (key_name[0] == (int)KS_PTERM_MOUSE)
|
||||
if (key_name[0] == KS_PTERM_MOUSE)
|
||||
{
|
||||
int button, num_clicks, action;
|
||||
|
||||
@@ -5705,14 +5712,14 @@ check_termcode(
|
||||
{
|
||||
# ifdef CHECK_DOUBLE_CLICK
|
||||
# ifdef FEAT_MOUSE_GPM
|
||||
# ifdef FEAT_GUI
|
||||
/*
|
||||
* Only for Unix, when GUI or gpm is not active, we handle
|
||||
* multi-clicks here.
|
||||
* Only for Unix, when GUI not active, we handle
|
||||
* multi-clicks here, but not for GPM mouse events.
|
||||
*/
|
||||
if (gpm_flag == 0 && !gui.in_use)
|
||||
# ifdef FEAT_GUI
|
||||
if (key_name[0] != KS_GPM_MOUSE && !gui.in_use)
|
||||
# else
|
||||
if (gpm_flag == 0)
|
||||
if (key_name[0] != KS_GPM_MOUSE)
|
||||
# endif
|
||||
# else
|
||||
# ifdef FEAT_GUI
|
||||
@@ -5800,7 +5807,7 @@ check_termcode(
|
||||
|
||||
/* Work out our pseudo mouse event. Note that MOUSE_RELEASE gets
|
||||
* added, then it's not mouse up/down. */
|
||||
key_name[0] = (int)KS_EXTRA;
|
||||
key_name[0] = KS_EXTRA;
|
||||
if (wheel_code != 0
|
||||
&& (wheel_code & MOUSE_RELEASE) != MOUSE_RELEASE)
|
||||
{
|
||||
|
@@ -767,6 +767,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1265,
|
||||
/**/
|
||||
1264,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user