LWJGL Windows-Linux compatibility

I restarted my most recent project to get to the bottom of why it does not work in a Linux environment. I have narrowed it down to the mouse being the problem. When the mouse is grabbed, I contantly set the mouse position to half of the width and height, but Linux seems to completely ignore this statement.

Mouse.setCursorPosition((int) orth.getWidth() / 2, (int) orth.getHeight() / 2);

If I grab the mouse in windows, move around, and un-grab the mouse, the cursor is at the center of the screen. But if I do this in Linux (Ubuntu) my cursor just moves about like I never called the setCursorPosition method. Is this a known bug?

Maybe a bug with your Linux graphics driver? Do you know which one you have?

Thanks for the reply, I am running Linux off of a VM, so would my graphics card be the same? If so, I have a NVIDIA Optimus.

Yes, it should be the same. That’s interesting, I have no real clue why that would be buggy like that. Maybe someone else can shed some light?

If you’re running off a VM then you can expect little things like that to happen.

There are plenty of people on this forum who are running Linux, so you could just ask for someone to test it and see if it actually happens in a real Linux environment.

(running linux here, Arch Linux)
I admit, I’m too lazy to write a little test .jar myself.

If you’d write a little .jar for me where I can press G to toogle mouse grapping and where the mouse position would be displayed, that’d be awesome, and I’d be happy to test that for you :slight_smile:

(excuse my lazyness :stuck_out_tongue: )

Both VMWare and VirtualBox use a custom “virtual graphics card” to emulate graphics acceleration on the guests. So it is fair that some OpenGL applications work differently on the VMed OSes and regular OSes.

I’m just as lazy.
Running the same distribution though. I’m sure if you gave us a download link we may find the brain power to click it and run the file. We may require an espresso as well :wink: