0

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.

asked Nov 19, 2025 at 20:21
1
  • You can try X11 instead of Wayland. Commented Dec 27, 2025 at 17:49

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.