Hi,

On Mon, Apr 24, 2017 at 07:47:06PM +0300, Alex Efros wrote:
> I've noticed matcher plugin break text selection inside urls:
> - start urxvt with default plugins
> - type `echo start http://google.com/ end`
> - click button 1 somewhere outside of url
> - now try to select anything inside url, like word "google" - when you
>   press button 1 inside url text large area from point of previous
>   selection or previous button 1 click position to current mouse position
>   is selected, and if you release button 1 inside url - it will be opened
>   in browser

thanks for the report.

> The fix is trivial - just delete "return 1" in on_button_press() handler
> of matcher extension. This makes selection works as usually and url opens
> in browser only if no more than one symbol inside url will be selected
> (which just compensate unintentional mouse move while clicking inside url).

That would be only a workaround. It is normal for extensions to return a
true value in a hook when consuming an event. The behaviour you observe
is due to a bug in how urxvt manages mouse events. Can you try the
attached patch?

Emanuele
diff --git a/src/command.C b/src/command.C
index 19e4fcc..77d9919 100644
--- a/src/command.C
+++ b/src/command.C
@@ -1876,6 +1876,9 @@ rxvt_term::button_press (XButtonEvent &ev)
    */
   if (ev.window == vt)
     {
+      clickintime = ev.time - MEvent.time < multiClickTime;
+      MEvent.time = ev.time;
+
       if (HOOK_INVOKE ((this, HOOK_BUTTON_PRESS, DT_XEVENT, &ev, DT_END)))
         return;
 
@@ -1888,8 +1891,6 @@ rxvt_term::button_press (XButtonEvent &ev)
         }
 #endif
 
-      clickintime = ev.time - MEvent.time < multiClickTime;
-
       if (reportmode)
         {
           /* mouse report from vt window */
@@ -1973,7 +1974,6 @@ rxvt_term::button_press (XButtonEvent &ev)
             }
         }
 
-      MEvent.time = ev.time;
       return;
     }
 
_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/mailman/listinfo/rxvt-unicode

Reply via email to