I'm working on a data visualization project using Processing (by means of Java within the NetBeans IDE) and I've discovered a strange bug. My application has two separate windows, one is a control panel (Controller within the ControlFrame) and the other is a 3D view (ViewWindow). Both windows are PApplets, and both use ControlP5. The basic structure is like this:
**Note that this is only an architectural overview - it does not exhibit the bug. I tried for hours to replicate the bug with this minimal code, but the bug is actually only manifest the thousands of lines of my project code. Sorry :(
Bug: (on Linux only - everything is fine on OS X)
- With Processing 2.01 or 2.02, I can change which window is in focus by clicking between them, but keyPressed() events are *only* sent to the main ViewWindow (ie. "Controller keyPressed()" would never be printed).
- With Processing 2.0b8 or 2.0b9, the keyPressed() events are called for whichever window is in focus (ie. "Controller keyPressed()" and "ViewWindow keyPressed()" are printed as expected).
Like I said, the minimal example above doesn't actually replicate the bug, just the program architecture. I don't want to clutter up the main post with an ocean of code.
So, since the bug is only with the new stable releases of Processing 2 (not the betas), there must have been some change to the window input focus system.
Does anyone know of any changes that happened after 2.0b9 that would have the effect of locking keyboard input focus to a single PApplet window?