aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-11-10 20:59:03 +0100
committerSven Gothel <[email protected]>2013-11-10 20:59:03 +0100
commit45ce96db65fa7cbfd3bcb3dd4503bc6251d2e493 (patch)
tree5921073f82ffc7468c2c18932672679e99568fb4 /src/nativewindow/classes/com/jogamp
parentb7672bbe54d406dbf347673a85b9c9e4a8e6469a (diff)
Fix Bug 889 [Related: Bug 816, Bug 849, Bug 729] - GLCanvas disappear when moves between two JFrame
When JAWTWindow's visibility tracker updates component's local visibility, it should read it's local visibility state instead 'trusting' the passed state. Make JAWTWindow's visibility tracker DEBUG output more brief for readability.
Diffstat (limited to 'src/nativewindow/classes/com/jogamp')
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
index a99737613..87966c9c6 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
@@ -124,21 +124,32 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
private boolean globalVisibility = localVisibility;
private boolean visibilityPropagation = false;
- private String id(Object obj) { return "0x"+Integer.toHexString(obj.hashCode()); }
+ private String id(Object obj) { return "0x" + ( null!=obj ? Integer.toHexString(obj.hashCode()) : "nil" ); }
+ private String str(Object obj) {
+ if( null == obj ) {
+ return "null";
+ } else if( obj instanceof Component ) {
+ final Component c = (Component)obj;
+ return c.getClass().getSimpleName()+"[visible "+c.isVisible()+", showing "+c.isShowing()+", valid "+c.isValid()+
+ ", displayable "+c.isDisplayable()+", "+c.getX()+"/"+c.getY()+" "+c.getWidth()+"x"+c.getHeight()+"]";
+ } else {
+ return obj.getClass().getSimpleName()+"[..]";
+ }
+ }
private String s(ComponentEvent e) {
return "visible[local "+localVisibility+", global "+globalVisibility+", propag. "+visibilityPropagation+"],"+Platform.getNewline()+
- " ** COMP "+id(e.getComponent())+": "+e.getComponent()+Platform.getNewline()+
- " ** SOURCE "+id(e.getSource())+": "+e.getSource()+Platform.getNewline()+
- " ** THIS "+component;
+ " ** COMP "+id(e.getComponent())+": "+str(e.getComponent())+Platform.getNewline()+
+ " ** SOURCE "+id(e.getSource())+": "+str(e.getSource())+Platform.getNewline()+
+ " ** THIS "+id(component)+": "+str(component);
}
private String s(HierarchyEvent e) {
return "visible[local "+localVisibility+", global "+globalVisibility+", propag. "+visibilityPropagation+"], changeBits 0x"+Long.toHexString(e.getChangeFlags())+Platform.getNewline()+
- " ** COMP "+id(e.getComponent())+": "+e.getComponent()+Platform.getNewline()+
- " ** SOURCE "+id(e.getSource())+": "+e.getSource()+Platform.getNewline()+
- " ** CHANGED "+id(e.getChanged())+": "+e.getChanged()+Platform.getNewline()+
- " ** CHANGEDPARENT "+id(e.getChangedParent())+": "+e.getChangedParent()+Platform.getNewline()+
- " ** THIS "+component;
+ " ** COMP "+id(e.getComponent())+": "+str(e.getComponent())+Platform.getNewline()+
+ " ** SOURCE "+id(e.getSource())+": "+str(e.getSource())+Platform.getNewline()+
+ " ** CHANGED "+id(e.getChanged())+": "+str(e.getChanged())+Platform.getNewline()+
+ " ** CHANGEDPARENT "+id(e.getChangedParent())+": "+str(e.getChangedParent())+Platform.getNewline()+
+ " ** THIS "+id(component)+": "+str(component);
}
@Override
@@ -207,7 +218,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
} else if( changed == component ) {
// Update component's local visibility state
if(!visibilityPropagation) {
- localVisibility = showing;
+ localVisibility = component.isVisible();
}
visibilityPropagation = false;
if(DEBUG) {