LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Morin on May 19, 2014, 05:34:20

Title: Mouse.setGrabbed() accumulates
Post by: Morin on May 19, 2014, 05:34:20
Hi all,

I'm having a strange problem with Mouse.setGrabbed(). Calling setGrabbed(true) multiple times, that is calling it again when the cursor is already grabbed, seems to "accumulate", kind of like a hidden counter that counts how often I called it. When I want to un-grab the mouse, I have to call setGrabbed(false) the same number of times until the mouse is finally un-grabbed.

I have observed this behavior on Mac OS X 10.7.5, LWJGL 2.9.1, jinput 2.0.5, JDK 1.7.0_45

Is this intended behavior?
Is there any cost associated with this "accumulation"? Such as, (wild speculation) decorator-pattern objects piling up?

It should be easy to work around this, but anyway it doesn't seem "right" to me.