From e228acfcf5be36fb161043bb2ae21f8d60bc6ca4 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 16 Sep 2011 12:40:46 +0200 Subject: NEWT Cleanup: AWT driver fix, WindowImpl createNative .., minor edits AWT driver fix - setVisible at creation, using reconfigureWindow impl (fixed WindowImpl createNative .., - no double visibility check on creation - visible:=true anyway for later creation, if failed or not available yet --- src/newt/classes/jogamp/newt/WindowImpl.java | 7 ++--- .../classes/jogamp/newt/driver/awt/AWTWindow.java | 34 ++++++++++++---------- 2 files changed, 20 insertions(+), 21 deletions(-) (limited to 'src/newt') diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index dd8752613..420e9d1fa 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -294,7 +294,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } // always flag visible, // allowing to retry if visible && !isNativeValid() - setVisibleImpl(true, x, y, width, height); + visible = true; } } finally { if(null!=parentWindow) { @@ -693,10 +693,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer if(!isNativeValid() && visible) { if( 0=0)?x:AWTWindow.this.x; y=(x>=0)?y:AWTWindow.this.y; width=(width>0)?width:AWTWindow.this.width; @@ -199,14 +199,16 @@ public class AWTWindow extends WindowImpl { container.setSize(width + insets.left + insets.right, height + insets.top + insets.bottom); - if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) { - config = canvas.getAWTGraphicsConfiguration(); - - if (config == null) { - throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this); + if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) { + if( 0 != ( FLAG_IS_VISIBLE & flags ) ) { + if( !hasDeviceChanged() ) { + // oops ?? + config = canvas.getAWTGraphicsConfiguration(); + if(null == config) { + throw new NativeWindowException("Error: !hasDeviceChanged && null == GraphicsConfiguration: "+this); + } + } } - - updateDeviceData(); visibleChanged(0 != ( FLAG_IS_VISIBLE & flags)); } -- cgit v1.2.3