Re: key release event "leaked"

dmb <[email protected]> Wed, 10 May 2023 20:33:06 -0400
Newsgroups gmane.comp.window-managers.stumpwm.devel
Message-ID <[email protected]>
Hi,

Thanks for the report!

I think we'll have to think about tthis a bit.  My gut reaction is that we
should slurp both events, but there may be something obscure in the standar=
ds
for window managers that we have to respect (I kind of doubt it though).

Does this specifically break your workflow somehow?  If its an interesting =
bit
of trivia it would be lower priority.  I think it shouldn't be too hard to =
slurp
the events, but I don't have a whole lot of time to look into it.

Sincerely,

David


cage <[email protected]> writes:

> Hi!
>
> I do not  know if the behaviour is  a bug or not so I  am sending this
> message here.
>
> When  the screen  is split  (vertically or  horizontally, it  does not
> matter), in my case  using 'C-p 3', the event "the  key for number '3'
> has been pressed" is captured by the WM but the event that immediately
> follows: "the key  for number '3' has been released",  is not captured
> and "leaks" to  the widget that has the focus  in the application that
> had the focus.
>
> To  better  illustrate  this  behaviour  I  have  written  this  brief
> function (TK interpreter (wish) is needed):
>
> -----------=E2=9C=80-----------=E2=9C=80-----------=E2=9C=80-----------
>
> (ql:quickload "nodgui")
>
> (defun main ()
>   (nodgui:with-nodgui ()
>     (let ((entry  (make-instance 'nodgui:entry)))
>       (nodgui:bind entry
>                 "<KeyRelease>"
>                 (lambda (e) (format t "keyrelease ~s~%" e)))
>       (nodgui:bind entry
>                 "<KeyPress>"
>                 (lambda (e) (format t "keypress ~s~%" e)))
>       (nodgui:grid entry  0 0)
>       (nodgui:focus entry))))
>
> -----------=E2=9C=80-----------=E2=9C=80-----------=E2=9C=80-----------
>
> after loading this code and calling the function 'main' a simple
> window with a text entry is shown, the entry get the focus.
>
> Splitting the screen will fire the event "<KeyRelease>" (I do not know
> the way this  event is called in  the X11 protocol, so I  am using the
> TCL/TK term) and  the event is printed on  *standard-output*, you will
> see that  the event has  a char slot  that has a  value of '3'  or '2'
> depending of the splitting command.
>
> I am not  sure that this could  be considered a bug, that  is, the key
> release should  be swallowed by  stumpwm together with  the "keypress"
> event, or it is  up to the GUI application to  deal with this spurious
> "keyrelease" events.
>
> Looking forward for your opinion!
>
> Bye!
> C.