mouse icon indicating copy to clipboard operation
mouse copied to clipboard

On Wayland, get_position only reports the last time the cursor was over the Python window

Open thelabcat opened this issue 1 year ago • 0 comments

I am using Fedora 40 spin KDE Plasma. As stated, mouse position reporting breaks if the mouse is not over any of the windows created by Python. To reproduce:

  1. Run sudo idle3 (must have IDLE installed)
  2. Enter the following live code:
import mouse
import time
while True:
    print(mouse.get_position())
    time.sleep(0.5)
  1. Move the mouse around. The printed position will only update while the mouse is over the IDLE window. If you run the same code in Python via the terminal, the mouse position does not update at all, presumably because the terminal window was not created by Python.

thelabcat avatar Jul 01 '24 05:07 thelabcat