diff options
author | Sven Gothel <[email protected]> | 2013-06-18 04:01:29 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-06-18 04:01:29 +0200 |
commit | e3beec5a0b4f696e458e8cc1d653ce9dc628e137 (patch) | |
tree | abe7ae46acc3008b4a89c737d814eb6cd328388f /src/newt | |
parent | 893cf0c8c32edf231dbf418d45d3181532d2402b (diff) |
NewtCanvasAWT: Issue 'setFocusable(..)' at configureNewtChild(..)
Diffstat (limited to 'src/newt')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java index 692741a88..65b44b141 100644 --- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java +++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java @@ -533,6 +533,9 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto newtChildCloseOp = newtChild.setDefaultCloseOperation(WindowClosingMode.DO_NOTHING_ON_CLOSE); keyboardFocusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); keyboardFocusManager.addPropertyChangeListener("focusOwner", focusPropertyChangeListener); + // force this AWT Canvas to be focus-able, + // since this it is completely covered by the newtChild (z-order). + setFocusable(true); if(isOnscreen) { // onscreen newt child needs to fwd AWT focus newtChild.setKeyboardFocusHandler(newtFocusTraversalKeyListener); @@ -545,6 +548,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto newtChild.removeWindowListener(clearAWTMenusOnNewtFocus); newtChild.setFocusAction(null); newtChild.setDefaultCloseOperation(newtChildCloseOp); + setFocusable(false); } } } @@ -581,9 +585,6 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto configureNewtChild(true); newtChild.sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout to listener - // force this AWT Canvas to be focus-able, - // since this it is completely covered by the newtChild (z-order). - setFocusable(true); if(DEBUG) { System.err.println("NewtCanvasAWT.attachNewtChild.X: win "+newtWinHandleToHexString(newtChild)+", EDTUtil: cur "+newtChild.getScreen().getDisplay().getEDTUtil()+", comp "+this); } |