Skip to content

Correctly disables the XRecord context. (probably)#583

Open
fukuchi wants to merge 1 commit intomoses-palmer:masterfrom
fukuchi:xorg_fix
Open

Correctly disables the XRecord context. (probably)#583
fukuchi wants to merge 1 commit intomoses-palmer:masterfrom
fukuchi:xorg_fix

Conversation

@fukuchi
Copy link
Copy Markdown

@fukuchi fukuchi commented Jan 17, 2024

When using pynput on a Xorg server, if I start a MouseListener and/or KeyboardListener, stop it after a while, and then join, it does not join immediately. The join will not be completed until a mouse or key event occurs afterward. A test program can be retrieved from the following gist:

https://gist.github.com/fukuchi/b06c30f04cd69b396f127d2b781c1ff3

This is because the context enabled in _run() in _util/xorg.py is not correctly disabled in _stop_platform().

This pull request fixes this problem. However, I am not familiar with Xlib programming and XRecord extensions, so I am not sure why this works correctly.

I have tested this patch on Ubuntu 22.04 (Python 3.10.12) and Ubuntu 23.10 (Python 3.11.6).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant