3

In an attempt to continue using my PC whilst automating a GUI application, I have created 2 pointers on my machine using xinput, one being controlled by me, the other by pyautogui.

on my system this is done by:

xinput create-master mynewpointer
xinput reattach 10 11

I use master pointer 11 pyautogui uses default pointer 2

However the pointers conflict with each other in various ways, snatching focus from each other being one of the major problems.

Even using xinput --map-to-output or --set-cp does not work, the pointer still "flicks" back from the window/monitor being tested when my pointer grabs focus on a new window.

Is there anyway to seperate these pointers?

keda
  • 82
  • 1
  • 8

1 Answers1

2

Perhaps instead you could just use a separate dedicated X11 server for the application. This can be as simple as running

Xnest :1 &

and then running your app under DISPLAY=:1. However, the cursor is not shown unless the real cursor is in the window, and moving your cursor into the window will move the Xnest cursor.

Another alternative is to start a VNC server. This is a bit more independent.

vncserver :1 securitytypes=none -interface localhost
vncviewer :1

There is also the Xephyr nested server, which is like Xnest but adds many features that the underlying server might not have, and also exists in a version with OpenGL.

meuh
  • 49,672
  • 2
  • 52
  • 114