From edbee9a1f34929e9bd3119bac88ab1c759c569a3 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Fri, 16 Sep 2011 13:15:34 +0200
Subject: NEWT/WindowImpl: Remove wait for position (keep waitForSize for
reparent/fullscreen)
Window position is not deterministic enough and slows down processing while sync on it
---
src/newt/classes/jogamp/newt/WindowImpl.java | 27 ++++++---------------------
1 file changed, 6 insertions(+), 21 deletions(-)
(limited to 'src/newt/classes/jogamp')
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index 420e9d1fa..9d54954b0 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -273,18 +273,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
throw new InternalError("XXX");
}
if(canCreateNativeImpl()) {
- int _x = x, _y = y; // orig req pos
screen.addReference();
screenReferenceAdded = true;
createNativeImpl();
screen.addScreenModeListener(screenModeListenerImpl);
setTitleImpl(title);
if(waitForVisible(true, false)) {
- // fix req position about window decoration
- _x = Math.max(_x, insets.getLeftWidth());
- _y = Math.max(_y, insets.getTopHeight());
- // wait for user req position
- waitForPosSize(_x, _y, width, height, false, TIMEOUT_NATIVEWINDOW);
if(isFullscreen()) {
fullscreen = false;
FullScreenActionImpl fsa = new FullScreenActionImpl(true);
@@ -400,13 +394,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* The implementation should invoke the referenced java state callbacks
* to notify this Java object of state changes.
*
- *
- * In case the implementation supports a deterministic size/pos mechanism,
- * i.e. is able to determine the correct size/pos,
- * it shall invalidate such values via the callbacks allowing the caller
- * to wait until the values are reached - notified by the WM.
- * This is currently implemented for X11 and Windows.
- *
* @see #windowDestroyNotify()
* @see #focusChanged(boolean)
* @see #visibleChanged(boolean)
@@ -1127,7 +1114,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
ok = WindowImpl.this.waitForVisible(true, false);
display.dispatchMessagesNative(); // status up2date
if(ok) {
- ok = WindowImpl.this.waitForPosSize(-1, -1, width, height, false, TIMEOUT_NATIVEWINDOW);
+ ok = WindowImpl.this.waitForSize(width, height, false, TIMEOUT_NATIVEWINDOW);
}
if(ok) {
requestFocusImpl(true);
@@ -1625,7 +1612,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
setVisibleImpl(true, x, y, w, h);
WindowImpl.this.waitForVisible(true, false);
display.dispatchMessagesNative(); // status up2date
- WindowImpl.this.waitForPosSize(-1, -1, w, h, false, TIMEOUT_NATIVEWINDOW);
+ WindowImpl.this.waitForSize(w, h, false, TIMEOUT_NATIVEWINDOW);
display.dispatchMessagesNative(); // status up2date
requestFocusImpl(true);
display.dispatchMessagesNative(); // status up2date
@@ -2202,14 +2189,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
- private boolean waitForPosSize(int x, int y, int w, int h, boolean failFast, long timeOut) {
+ private boolean waitForSize(int w, int h, boolean failFast, long timeOut) {
DisplayImpl display = (DisplayImpl) screen.getDisplay();
- final boolean wpos = 0