]> git.wh0rd.org Git - nano.git/commitdiff
in disable_mouse_support() and enable_mouse_support(), when toggling
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 4 Dec 2007 20:49:09 +0000 (20:49 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Tue, 4 Dec 2007 20:49:09 +0000 (20:49 +0000)
mouse support on or off, save and restore the mouse click interval

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4186 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/nano.c

index 7257842dcb4cf3bdecf90e4f03c78e1a8732b4ed..adeb4906cbdc490ef6b56eebb508dd2934a9f5d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@
        tweaks by me, add wnoutrefresh() calls after
        reset_(statusbar_)?cursor() calls, to ensure that the cursor is
        placed properly when using NetBSD curses.
+       * nano.c (disable_mouse_support, enable_mouse_support): When
+       toggling mouse support on or off, save and restore the mouse
+       click interval.
 
 2007-11-29  Jean-Philippe GuĂ©rard <jean-philippe.guerard@tigreraye.org>
 
index dd7ae31518cccaa30a1dbf4bc0196018695acbeb..483ee44933ec60fa1eb28f877ce6946005cb01b0 100644 (file)
 #include <sys/ioctl.h>
 #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? */
@@ -711,13 +715,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,