GLWindow.warpPointer() does not work on Linux, it has absolutely no effect. I use Mageia Linux 1, KDE 4.6, the dev build 535 of JOGL 2.0, OpenJDK 1.6, AMD Sempron 2600+ (32 bits), NVIDIA Geforce 7600 GT. The bug is reproducible on Cent OS Linux 5.3 with Intel core duo and NVIDIA Quadro FX 3600. A possible root cause and its fix are here: http://forum.jogamp.org/JOGL-Update-New-NEWT-Mouse-Features-tp3420099p3453058.html I cannot provide a JUnit test because there is no way of retrieving the abscissa and the ordinate of the mouse cursor in pure NEWT. Anyway, you can reproduce this bug by adding a call to warpPointer(20,20) into https://github.com/sgothel/jogl/blob/master/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java and by using java.awt.MouseInfo.getPointerInfo().getLocation() (which won't work on embedded platforms with no support of AWT of course).
I've just marked this bug as major because it is problematic for the JOGL 2.0 renderer of Ardor3D.
Manual test works on all X11/xorg machines as desired: bash scripts/tests-x64.sh -time 10000000 -vsync java com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT -time 10000000 -vsync Ubuntu 11.04 Ubuntu 11.10 CentOS 6.0 Solaris 10 +++ Julien's post: warpPointer() does not work on my machine, I have just tested it with TUER, it does not throw any exception, it just does nothing :( I use Mageia Linux 1, KDE 4.6, the latest dev build of JOGL 2 (535), OpenJDK 1.6. I will have to investigate. Edit.: There is something wrong here: <snip/> JNIEXPORT void JNICALL Java_jogamp_newt_driver_x11_X11Window_warpPointer0 (JNIEnv *env, jclass clazz, jlong display, jlong window, jint x, jint y) { Display * dpy = (Display *) (intptr_t) display; Window w = (Window)window; DBG_PRINT( "X11: warpPointer0: %d/%d\n", x, y); XWarpPointer(dpy, None, w, 0, 0, 0, 0, x, y); } I would rather call XWarpPointer(dpy, w, None, 0, 0, 0, 0, x, y); because XWarpPointer needs the source window to get its width and its height (when src_width and src_height are set to zero). If you pass None, it cannot "know" them. Ok I'm falling asleep, good night. +++ According to: http://tronche.com/gui/x/xlib/input/XWarpPointer.html If dest_w is None, XWarpPointer() moves the pointer by the offsets (dest_x, dest_y) relative to the current position of the pointer. If dest_w is a window, XWarpPointer() moves the pointer to the offsets (dest_x, dest_y) relative to the origin of dest_w. However, if src_w is a window, the move only takes place if the window src_w contains the pointer and if the specified rectangle of src_w contains the pointer. The src_x and src_y coordinates are relative to the origin of src_w. If src_height is zero, it is replaced with the current height of src_w minus src_y. If src_width is zero, it is replaced with the current width of src_w minus src_x. +++ Hence we use it as advertised, ie. we only pass the destination window and it's client space (relative window coordinates). We don't want to move the mouse position relative from it's current position (src_w given, dest_w NULL) nor want we to restrict this function to the case where the mouse is within the window (both given and current mouse shall reside within src rectangular). Besides .. the manual test works. I may add a unit test utilizing a mouse listener. The
Is it intended to work like AWT Robot? I will test it again.
Re: CentOS, see bug 451, comment 3
Hi I confirm it works fine on CentOS 5.3, I have just used TestGearsES2NEWT by pressing 'w'. I have to perform this test on Mageia Linux 1.
I confirm it works fine on Mageia Linux 1, the mistake came from my source code, see JoglNewtMouseManager and JoglNewtMouseWrapper.