-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: rxvt-unicode-sixel
action: commit
revision:
path_from:
revision_from: bf82c5439d692e98acd5f0f5b751574b6ff538b7:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

commit bf82c5439d692e98acd5f0f5b751574b6ff538b7
Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com>
Date:   Sat Aug 16 10:51:23 2014 +0000

    Add -mc option and multiClickTime resource, patch by Joe Peterson.

diff --git a/Changes b/Changes

index 3092e6fe21b4c7da03d4b0be883f1634fd7c6f2b..

index ..a29371a9dc933cdbbfea42f88ec883f0a753f05b 100644

--- a/Changes
+++ b/Changes
@@ -37,6 +37,8 @@ TODO: document typical actions in rxvt.1.pod keysyms
 TODO: document meta comments and on_action hook
 TODO: perl one-liner

+	- Add -mc option and multiClickTime resource to set the maximum time
+	  between multi-click select events (patch by Joe Peterson).
 	- New 'eval' extension to evaluate arbitrary perl code with keysym
 	  bindings. The extension also provides methods that implement basic
 	  actions, such as pasting selections and scrolling.
diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod

index 15a1a79ca867be9fd1a3cd2e5d6f9f809482a4aa..

index ..c4ef7bc54d5a88ce3cbd634fffa830e71aa3f8ae 100644

--- a/doc/rxvt.1.pod
+++ b/doc/rxvt.1.pod
@@ -221,6 +221,10 @@ rather than the default executable file name. Name should not contain

 Start as a login-shell/sub-shell; resource B<loginShell>.

+=item B<-mc> I<milliseconds>
+
+Specify the maximum time between multi-click selections.
+
 =item B<-ut>|B<+ut>

 Compile I<utmp>: Inhibit/enable writing a utmp entry; resource
@@ -788,6 +792,11 @@ B<True>: start as a login shell by prepending a `-' to B<argv[0]> of
 the shell; option B<-ls>. B<False>: start as a normal sub-shell
 [default]; option B<+ls>.

+=item B<multiClickTime:> I<number>
+
+Specify the maximum time in milliseconds between multi-click select
+events. The default is 500 milliseconds; option B<-mc>.
+
 =item B<utmpInhibit:> I<boolean>

 B<True>: inhibit writing record into the system log file B<utmp>;
diff --git a/src/command.C b/src/command.C

index d2316f550a41d761aabaea1ebf4983621fe8ce05..

index ..6ae23bcfb0d0f455902ac8cad1ede1efabab8021 100644

--- a/src/command.C
+++ b/src/command.C
@@ -1913,7 +1913,7 @@ rxvt_term::button_press (XButtonEvent &ev)
         }
 #endif

-      clickintime = ev.time - MEvent.time < MULTICLICK_TIME;
+      clickintime = ev.time - MEvent.time < multiClickTime;

       if (reportmode)
         {
@@ -2173,7 +2173,7 @@ rxvt_term::button_release (XButtonEvent &ev)
           if (MEvent.button != AnyButton
               && (ev.button != MEvent.button
                   || (ev.time - MEvent.time
-                      > MULTICLICK_TIME / 2)))
+                      > multiClickTime / 2)))
             {
               MEvent.clicks = 0;
               MEvent.button = AnyButton;
diff --git a/src/command.h b/src/command.h

index 03ba3b1707289d8bca4488e7f5a5b80ed2e40efc..

index ..cf356c4dd03a7009398055f0f15aa6d287d82c16 100644

--- a/src/command.h
+++ b/src/command.h
@@ -7,9 +7,6 @@

 #define ESC_ARGS	32	/* max # of args for esc sequences */

-#ifndef MULTICLICK_TIME
-# define MULTICLICK_TIME	500
-#endif
 #ifndef SCROLLBAR_INITIAL_DELAY
 # define SCROLLBAR_INITIAL_DELAY	0.33
 #endif
diff --git a/src/init.C b/src/init.C

index 78d93158d0e2382600cf81d632eeb53afc4d4a1a..

index ..5651b448c2cd26997130370e18b35bbcff2a6399 100644

--- a/src/init.C
+++ b/src/init.C
@@ -662,6 +662,11 @@ rxvt_term::init_resources (int argc, const char *const *argv)
     pointerBlankDelay = 2;
 #endif

+  if (rs[Rs_multiClickTime] && (i = atoi (rs[Rs_multiClickTime])) >= 0)
+    multiClickTime = i;
+  else
+    multiClickTime = 500;
+
   /* no point having a scrollbar without having any scrollback! */
   if (!saveLines)
     set_option (Opt_scrollBar, 0);
diff --git a/src/optinc.h b/src/optinc.h

index af68751d85f8a534c2f91bc0bdb31983b29ee1ef..

index ..09f9a26a5edb54baf89d020d35772208196a833a 100644

--- a/src/optinc.h
+++ b/src/optinc.h
@@ -1,6 +1,7 @@
 // all resource indices, used by rxvt.h and rxvtperl.xs

  def(loginShell)
+ def(multiClickTime)
  def(iconic)
  def(visualBell)
  def(mapAlert)
diff --git a/src/rsinc.h b/src/rsinc.h

index 14839553d6189284559a44ad8807e4514ef10db6..

index ..682322c360aa059d04be1dd38c779b2e1b2ddeff 100644

--- a/src/rsinc.h
+++ b/src/rsinc.h
@@ -22,6 +22,7 @@
   def (backgroundPixmap)
 #endif
   def (loginShell)
+  def (multiClickTime)
   def (jumpScroll)
   def (skipScroll)
   def (scrollBar)
diff --git a/src/rxvt.h b/src/rxvt.h

index d35fdf70cad535cc07a1dacf2ef2f77b152e594e..

index ..2a3ef27bf52f082c17f6907c76f9d3e49a75a284 100644

--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -1164,6 +1164,7 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen
 # ifdef POINTER_BLANK
                   pointerBlankDelay,
 # endif
+                  multiClickTime,
                   allowedxerror;
 /* ---------- */
   unsigned int    ModLevel3Mask,
diff --git a/src/xdefaults.C b/src/xdefaults.C

index 7ca99528648f5ee3a9b13f8cdbe0e86aa375e0d5..

index ..58ae19b527228b072ccbb7e3a76a99b21e7677ac 100644

--- a/src/xdefaults.C
+++ b/src/xdefaults.C
@@ -101,6 +101,7 @@ optList[] = {
               SWCH ("dockapp", Opt_dockapp, 0, "start as dockapp"),
               BOOL (Rs_reverseVideo, "reverseVideo", "rv", Opt_reverseVideo, 0, "reverse video"),
               BOOL (Rs_loginShell, "loginShell", "ls", Opt_loginShell, 0, "login shell"),
+              STRG (Rs_multiClickTime, "multiClickTime", "mc", "number", "Maximum time (in ms) between multi-click selections"),
               BOOL (Rs_jumpScroll, "jumpScroll", "j", Opt_jumpScroll, 0, "jump scrolling"),
               BOOL (Rs_skipScroll, "skipScroll", "ss", Opt_skipScroll, 0, "skip scrolling"),
               BOOL (Rs_pastableTabs, "pastableTabs", "ptab", Opt_pastableTabs, 0, "tab characters are pastable"),

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 13:25:24 2024