summaryrefslogtreecommitdiffstats
path: root/src/test/jogamp/newt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-11-19 19:32:00 +0100
committerSven Gothel <[email protected]>2011-11-19 19:32:00 +0100
commit8a985f8652151684063853f61e479d75d8203f07 (patch)
tree14acfc1230a974397e52803eefd6785f73be92c9 /src/test/jogamp/newt
parent2641d1cffebff214c4b37d7291627f76cc3bbe3f (diff)
NEWT/AWT Focus traversal enhancement/fix (incl. OS X fixes)
- MacWindow/OffscreeSurface - Exclude native NEWT window calls in case it's an offscreen surface - MacWindow/DriverClearFocus - Introduce driver detail DriverClearFocus interface - OS X needs to clear the focus, before another TK (eg. AWT) can claim it's (native parent window focus) - MacWindow/KeyCode: - Move OS X keyCode utils to MacKeyUtil - MacKeyUtil now uses OS X virtual key codes first, before matching keyChar -> keyCode - NewtCanvasAWT - Issue all AWT 'requestFocus()' on current thread, Newt-EDT -> AWT-EDT may freeze Window's native peer requestFocus() impl. - FocusAction directly issue action on Newt-EDT, also request AWT focus if not having it (proper AWT traversal) - Add an FocusPropertyChangeListener, detecting focus lost to issue DriverClearFocus's clearFocus() if available. - merge configureNewtChildInputEventHandler() code into configureNewtChild() to simplify call tree. - WindowImplAccess: Use getDelegatedWindow()
Diffstat (limited to 'src/test/jogamp/newt')
-rw-r--r--src/test/jogamp/newt/WindowImplAccess.java16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/test/jogamp/newt/WindowImplAccess.java b/src/test/jogamp/newt/WindowImplAccess.java
index 76d0dc050..e8be5f68a 100644
--- a/src/test/jogamp/newt/WindowImplAccess.java
+++ b/src/test/jogamp/newt/WindowImplAccess.java
@@ -29,26 +29,16 @@
package jogamp.newt;
import com.jogamp.newt.Window;
-import com.jogamp.newt.opengl.GLWindow;
/**
* Allows access to protected methods of WindowImpl
*/
public class WindowImplAccess {
public static final void windowDestroyNotify(Window win) {
- WindowImpl winImpl = null;
- if(win instanceof GLWindow) {
- GLWindow glwin = (GLWindow) win;
- winImpl = (WindowImpl) glwin.getWindow();
- } else if(win instanceof WindowImpl) {
- winImpl = (WindowImpl) win;
- } else {
- throw new RuntimeException("Given Window not a GLWindow, not WindowImpl, but "+win.getClass());
- }
- final WindowImpl winImplF = winImpl;
- winImplF.runOnEDTIfAvail(true, new Runnable() {
+ final WindowImpl winImpl = (WindowImpl) win.getDelegatedWindow();
+ winImpl.runOnEDTIfAvail(true, new Runnable() {
public void run() {
- winImplF.windowDestroyNotify();
+ winImpl.windowDestroyNotify();
}
});
}