key release event "leaked"

0 views
Skip to first unread message

cage

unread,
May 9, 2023, 12:20:01 PM5/9/23
to stumpw...@nongnu.org
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):

-----------✀-----------✀-----------✀-----------

(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))))

-----------✀-----------✀-----------✀-----------

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.

dmb

unread,
May 10, 2023, 8:34:08 PM5/10/23
to cage, stumpw...@nongnu.org
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 standards
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

unread,
May 11, 2023, 12:49:31 PM5/11/23
to dmb, cage, stumpw...@nongnu.org
On Wed, May 10, 2023 at 08:33:06PM -0400, dmb wrote:
> Hi,

Hi!

> Thanks for the report!

You're welcome!

> I think we'll have to think about tthis a bit. My gut reaction is that we
> should slurp both events,

i feel the same but, as I have no experience about X11 protocol, i am
unsure if this would be the correct thing to do.

[...]

> 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.

I have added a workaround that works more or less flawlessly so I can
deal with it. :)

I mean there is no rush! :)

Let me thank all you maintainers for stumpwm, this is the first tiling
WM I ever used, I admit I chose it because is hackable in common lisp,
but i found it awesome (no pun intended). :)

Bye!
C.

Reply all
Reply to author
Forward
0 new messages