I'm currently trying to learn some pyautogui. I wanted to create function, that will hold mouse button and move it from one point to another, but clicking functionality seems to be not working properly.
I tried to recreate script provided with documentation:
>>> distance = 200
>>> while distance > 0:
pyautogui.drag(distance, 0, duration=0.5) # move right
distance -= 5
pyautogui.drag(0, distance, duration=0.5) # move down
pyautogui.drag(-distance, 0, duration=0.5) # move left
distance -= 5
pyautogui.drag(0, -distance, duration=0.5) # move up
According to pyautogui docs, it should generate picture like this
And i've managed to do so on Linux Lite machine. However when i'm trying to run the same script on Fedora, i'm getting something like this
It looks like after every movement, position resets itself to starting point.
Do you by any chance know how to fix it? Most of other functions like screenshots, or getting pixel colors works fine, problem seems to be connected to mouse movement.
I'm using Fedora 42 with Wayland system protocol and Python 3.
-
You can try X11 instead of Wayland.Sébastien Guarnay– Sébastien Guarnay2025年12月27日 17:49:20 +00:00Commented Dec 27, 2025 at 17:49