aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-12-18 21:59:39 +0100
committerSven Gothel <[email protected]>2013-12-18 21:59:39 +0100
commit166e5da5298b16b0acbf900004964d370cd0aa29 (patch)
treec32c08a275b9a211b4f6db73fe72b7bd95046d5a /src/nativewindow/classes/com
parent82927b0e75a2a93f3728d158295a6ae25dddeecf (diff)
Bug 928 - JAWTWindow's JAWTComponentListener _not_ attached and original visibility state not restored @ detach
Commit ebed9f0322e2a2279a525e04ee3875c9034a7f45 (fix for Bug 906) causes a regression to fix for Bug 816, Bug 849 and Bug 889 (OSX CALayer Positioning and JAWTWindow visibility). The commit adds the JAWTComponentListener instance 'jawtComponentListener' to the component before it's assignment (duh!). +++ Further more, detaching the JAWTComponentListener shall restore the component's original 'local visibility state', which might got overridden by it's 'hierarchyChanged' implementation. +++
Diffstat (limited to 'src/nativewindow/classes/com')
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
index 9a19a7f7a..3c660b41b 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
@@ -159,20 +159,21 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
" ** THREAD "+getThreadName();
}
- public JAWTComponentListener() {
+ private JAWTComponentListener() {
if(DEBUG) {
- System.err.println(jawtStr()+".attach: "+toString());
+ System.err.println(jawtStr()+".attach @ Thread "+getThreadName()+": "+toString());
}
- component.addComponentListener(jawtComponentListener);
- component.addHierarchyListener(jawtComponentListener);
+ component.addComponentListener(this);
+ component.addHierarchyListener(this);
}
- public final void detach() {
+ private final void detach() {
if(DEBUG) {
- System.err.println(jawtStr()+".detach: "+toString());
+ System.err.println(jawtStr()+".detach @ Thread "+getThreadName()+": "+toString());
}
- component.removeComponentListener(jawtComponentListener);
- component.removeHierarchyListener(jawtComponentListener);
+ component.removeComponentListener(this);
+ component.removeHierarchyListener(this);
+ component.setVisible(localVisibility); // restore component's original local state
}
@Override
@@ -251,6 +252,11 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
} else if(DEBUG) {
System.err.println(jawtStr()+".hierarchyChanged SHOWING_CHANGED (x): showing "+showing+" -> visible "+(showing && localVisibility)+", "+s(e));
}
+ } else if(DEBUG) {
+ final boolean displayable = changed.isDisplayable();
+ final boolean _visible = displayable && localVisibility;
+ final boolean showing = changed.isShowing();
+ System.err.println(jawtStr()+".hierarchyChanged OTHER: displayable "+displayable+", showing "+showing+" -> visible "+_visible+", "+s(e));
}
}
}