aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-11-09 08:19:27 +0100
committerSven Gothel <[email protected]>2011-11-09 08:19:27 +0100
commite392af4430af6b7b6d7f30fcca2bf00081641fe1 (patch)
tree03e03885361e2b1cf8091375bc81be5d3ad80354
parent46542168d64b37f544f61802693f15b59b224e4e (diff)
Fix regression: setScreen(..) invalid ref count & flag
Undo parts of commits in this regard: - 46542168d64b37f544f61802693f15b59b224e4e: move method back to ReparentAction - f51e3dad6c4bd1f6d0001cecf6a0f692400ed602: remove added ref counter / flag
-rw-r--r--src/newt/classes/jogamp/newt/WindowImpl.java31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index 823868f2b..1ce02c8e4 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -308,30 +308,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return isNativeValid() ;
}
- private void recreate(boolean skipCreate) {
- if(DEBUG_IMPLEMENTATION) {
- System.err.println("Window.recreate() START ("+getThreadName()+", "+this+")");
- }
- if(!isNativeValid()) {
- throw new InternalError("XXX");
- }
- ScreenImpl retainedScreen = screen;
- retainedScreen.addReference(); // +1 - retain over destroy
- destroy();
- setScreen(retainedScreen);
- retainedScreen.removeReference(); // -1 - release
- if(!skipCreate) {
- setVisible(true); // native creation
- }
- }
-
- private void setScreen(ScreenImpl newScreen) { // never null !
- removeScreenReference();
- screen = newScreen;
- screen.addReference();
- screenReferenceAdded = false;
- }
-
private void removeScreenReference() {
if(screenReferenceAdded) {
// be nice, probably already called recursive via
@@ -847,7 +823,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
public void setSize(int width, int height) {
/** FIXME: freezes due to many resize events by eg AWT
if( isNativeValid() && !getGraphicsConfiguration().getChosenCapabilities().isOnscreen() ) {
- recreate(true); // skip create, create is done here ..
+ destroy(); // skip create, create is done here ..
}
*/
runOnEDTIfAvail(true, new SetSizeActionImpl(width, height));
@@ -964,6 +940,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return reparentAction;
}
+ private void setScreen(ScreenImpl newScreen) { // never null !
+ removeScreenReference();
+ screen = newScreen;
+ }
+
public final void run() {
boolean animatorPaused = false;
if(null!=lifecycleHook) {