matcher: on_button_press { return 1 }

Emanuele Giaquinta emanuele.giaquinta at gmail.com
Sat Apr 29 10:14:48 CEST 2017


Hi,

On Mon, Apr 24, 2017 at 11:22:08PM +0300, Alex Efros wrote:
> On Mon, Apr 24, 2017 at 10:50:32PM +0300, Emanuele Giaquinta wrote:
> > 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
> 
> But isn't matcher not "consume" this event? Yeah, it did some actions, but
> these actions didn't meant to prevent other handlers from consuming this
> event. The on_button_release IS consume event in case it opens url in
> browser, but for me it looks like on_button_press is not consume anything.

The point is that this issue is not specific to matcher; it may happen
with any extension that grabs press events for button 1. Normally, a
button 1 press event starts a new selection, while a mouse motion event
extends the current selection. However, if an extension grabs a button 1
press then urxvt does not process the event and therefore does not start
a new selection. Your scenario is as follows:

1 button 1 press (and release) outside the url -> new selection
2 button 1 press inside the url -> no new selection because matcher
  grabs the event
3 motion event -> the selection created in (1) is extended

> > is due to a bug in how urxvt manages mouse events. Can you try the
> > attached patch?
> 
> Thanks. I've tried it, but didn't notice any difference - issue wasn't
> fixed.

Yes, sorry. The only solution I can think of currently is to update the
selection state on a button press (maybe only button 1) regardless of
whether an extension consumed the event.

Emanuele



More information about the rxvt-unicode mailing list