Login  Register

Re: JOGL Update: New NEWT Mouse Features

Posted by gouessej on Oct 25, 2011; 11:12pm
URL: https://forum.jogamp.org/JOGL-Update-New-NEWT-Mouse-Features-tp3420099p3453058.html

Hi

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:
/*
* Class: Java_jogamp_newt_driver_x11_X11Window
* Method: warpPointer0
* Signature: (JJII)V
*/
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.
Julien Gouesse | Personal blog | Website