I think I found the problem.
This is my test.
I divide the display into two parts:
-on the left there is Pencil2D (a simple drawing app)
-on the right there is the Pure Data patch
xdotool_test3.pd
By clicking on the bang in pd, a circle is drawn in Pencil2D, at the point of desired (x,y) coordinates.
Very nice.
Note: it also works without the "Windows id" (which isn't there).
So, this happens:
in puredata: it works only introducing a delay > 100ms between "mouse move" and "mouse click". With a delay <100ms it doesn't work.
But...running directly from terminal it also works without delay:
me:~$ xdotool mousemove 600 400 && xdotool click 1
...a circle is drawn istantly, without delay.
How do you explain that in puredata I have to insert a delay > 100ms?
Now, the problem is that...trying with other windows of other "non-drawing" programs, it doesn't always work: the click doesn't always have an effect. I have to understand why. Yet the arrow moves and the arrival window is highlighted (therefore it is active), but the click has no effect.
@oid : about your patch "cursor.pd", I wasn't able to use it for my purpose, but it's so cool... I didn't know it could be done, beautiful.
Bye,
a.