diff options
author | Sven Gothel <[email protected]> | 2020-01-13 06:54:01 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-01-13 06:54:01 +0100 |
commit | 39af5ca418d0db9669aca5db77fa47e801e2a1d9 (patch) | |
tree | 7e05090f0d93f2e6fc06f2d763d615fe4cd5c2c9 | |
parent | 12bbb049b716282321c979ae78918801ef071884 (diff) |
Bug 1421 Related: Handle SWT Events: Activate (focus), Show and Hide.
Show and Hide handling resolves TabFolder layout,
i.e. hiding the 'hidden' and showing the current tab.
-rw-r--r-- | src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java index 738155140..8c38859e1 100644 --- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java +++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java @@ -193,6 +193,9 @@ public class NewtCanvasSWT extends Canvas implements NativeWindowHolder, WindowC if( DEBUG ) { System.err.println(shortName()+".Event.ACTIVATE, "+event); } + if( newtChildReady ) { + newtChild.requestFocus(false /* wait */); + } break; case SWT.Deactivate: // lost focus if( DEBUG ) { @@ -203,11 +206,17 @@ public class NewtCanvasSWT extends Canvas implements NativeWindowHolder, WindowC if( DEBUG ) { System.err.println(shortName()+".Event.SHOW, "+event); } + if( newtChildReady ) { + newtChild.setVisible(true); + } break; case SWT.Hide: if( DEBUG ) { System.err.println(shortName()+".Event.HIDE, "+event); } + if( newtChildReady ) { + newtChild.setVisible(false); + } break; case SWT.Resize: if( DEBUG ) { |