Skip to content

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

@thelabcat

Description

@thelabcat

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions