From aa48b24227906b74f02311bdf132fec24445bbfd Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Tue, 4 Dec 2007 20:49:09 +0000 Subject: [PATCH] in disable_mouse_support() and enable_mouse_support(), when toggling mouse support on or off, save and restore the mouse click interval git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_2_0_branch/nano@4186 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 +++ src/nano.c | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 60dbffa5..7fd8625a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,9 @@ CVS code - calls, to ensure that the cursor is placed properly when using NetBSD curses. Changes to main(), get_prompt_string(), and do_replace_highlight(). (OBATA Akio, minor tweaks by DLR) + - When toggling mouse support on or off, save and restore the + mouse click interval. Changes to disable_mouse_support() and + enable_mouse_support(). (DLR) - chars.c: nstrncasecmp(), mbstrncasecmp() - For efficiency, return zero immediately if s1 and s2 point to diff --git a/src/nano.c b/src/nano.c index 3a10e2af..6acbadae 100644 --- a/src/nano.c +++ b/src/nano.c @@ -40,6 +40,10 @@ #include #endif +#ifndef DISABLE_MOUSE +static int oldinterval = -1; + /* Used to store the user's original mouse click interval. */ +#endif #ifdef ENABLE_NANORC static bool no_rcfiles = FALSE; /* Should we ignore all rcfiles? */ @@ -710,13 +714,14 @@ void window_init(void) void disable_mouse_support(void) { mousemask(0, NULL); + mouseinterval(oldinterval); } /* Enable mouse support. */ void enable_mouse_support(void) { mousemask(ALL_MOUSE_EVENTS, NULL); - mouseinterval(50); + oldinterval = mouseinterval(50); } /* Initialize mouse support. Enable it if the USE_MOUSE flag is set, -- 2.39.5