aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-02-10 18:46:28 +0100
committerSven Gothel <[email protected]>2014-02-10 18:46:28 +0100
commitc3c204a2e374c1dc4c1fb51f15444e5b92850839 (patch)
treeb451b478f2d062b39167abbe739cd6a357f1ece5 /src/test/com/jogamp
parentc7ef2bf610ad3310aa9785820489f980c223cdb0 (diff)
Bug 970: NEWT OSX ChildWindow setVisible(..) does not hide child window appropriately
Instead of using [mWin orderBack: mWin] for child windows, utilize [mWin orderWindow: NSWindowOut relativeTo: [pWin windowNumber]]
Diffstat (limited to 'src/test/com/jogamp')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java83
1 files changed, 79 insertions, 4 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java
index 7beceb291..714c397f3 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java
@@ -374,10 +374,28 @@ public class TestParenting01NEWT extends UITestCase {
int state = 0;
Window.ReparentOperation reparentAction;
- while(animator1.isAnimating() && animator1.getTotalFPSDuration()<3*durationPerTest) {
+ while(animator1.isAnimating() && animator1.getTotalFPSDuration()<7*durationPerTest) {
Thread.sleep(durationPerTest);
switch(state) {
case 0:
+ // top-level glWindow2 hide
+ Assert.assertEquals(true, glWindow1.isVisible());
+ Assert.assertEquals(true, glWindow2.isVisible());
+ glWindow2.setVisible(false);
+ Assert.assertEquals(false, glWindow2.isVisible());
+ Assert.assertEquals(true, glWindow1.isVisible());
+ break;
+
+ case 1:
+ // top-level glWindow2 show
+ Assert.assertEquals(true, glWindow1.isVisible());
+ Assert.assertEquals(false, glWindow2.isVisible());
+ glWindow2.setVisible(true);
+ Assert.assertEquals(true, glWindow2.isVisible());
+ Assert.assertEquals(true, glWindow1.isVisible());
+ break;
+
+ case 2:
// glWindow2 -- child --> glWindow1: compatible
Assert.assertEquals(true, glWindow2.isVisible());
System.err.println("Frames(1) "+glWindow2.getTotalFPSFrames());
@@ -403,7 +421,25 @@ public class TestParenting01NEWT extends UITestCase {
break;
- case 1:
+ case 3:
+ // child glWindow2 hide
+ Assert.assertEquals(true, glWindow1.isVisible());
+ Assert.assertEquals(true, glWindow2.isVisible());
+ glWindow2.setVisible(false);
+ Assert.assertEquals(false, glWindow2.isVisible());
+ Assert.assertEquals(true, glWindow1.isVisible());
+ break;
+
+ case 4:
+ // child glWindow2 show
+ Assert.assertEquals(true, glWindow1.isVisible());
+ Assert.assertEquals(false, glWindow2.isVisible());
+ glWindow2.setVisible(true);
+ Assert.assertEquals(true, glWindow2.isVisible());
+ Assert.assertEquals(true, glWindow1.isVisible());
+ break;
+
+ case 5:
// glWindow2 --> top
Assert.assertEquals(true, glWindow2.isVisible());
@@ -566,10 +602,29 @@ public class TestParenting01NEWT extends UITestCase {
int state = 0;
Window.ReparentOperation reparentAction;
- while(animator1.isAnimating() && animator1.getTotalFPSDuration()<3*durationPerTest) {
+ while(animator1.isAnimating() && animator1.getTotalFPSDuration()<7*durationPerTest) {
Thread.sleep(durationPerTest);
switch(state) {
case 0:
+ // child glWindow2 hide
+ Assert.assertEquals(true, glWindow1.isVisible());
+ Assert.assertEquals(true, glWindow2.isVisible());
+ glWindow2.setVisible(false);
+ Assert.assertEquals(false, glWindow2.isVisible());
+ Assert.assertEquals(true, glWindow1.isVisible());
+ break;
+
+ case 1:
+ // child glWindow2 show
+ Assert.assertEquals(true, glWindow1.isVisible());
+ Assert.assertEquals(false, glWindow2.isVisible());
+ glWindow2.setVisible(true);
+ Assert.assertEquals(true, glWindow2.isVisible());
+ Assert.assertEquals(true, glWindow1.isVisible());
+ break;
+
+ case 2:
+ // glWindow2 --> top
Assert.assertEquals(true, glWindow2.isVisible());
reparentAction = glWindow2.reparentWindow(null, -1, -1, reparentHints);
Assert.assertTrue(Window.ReparentOperation.ACTION_INVALID != reparentAction);
@@ -584,7 +639,27 @@ public class TestParenting01NEWT extends UITestCase {
Assert.assertSame(display1,glWindow2.getScreen().getDisplay());
Assert.assertEquals(1,Display.getActiveDisplayNumber());
break;
- case 1:
+
+ case 3:
+ // top-level glWindow2 hide
+ Assert.assertEquals(true, glWindow1.isVisible());
+ Assert.assertEquals(true, glWindow2.isVisible());
+ glWindow2.setVisible(false);
+ Assert.assertEquals(false, glWindow2.isVisible());
+ Assert.assertEquals(true, glWindow1.isVisible());
+ break;
+
+ case 4:
+ // top-level glWindow2 show
+ Assert.assertEquals(true, glWindow1.isVisible());
+ Assert.assertEquals(false, glWindow2.isVisible());
+ glWindow2.setVisible(true);
+ Assert.assertEquals(true, glWindow2.isVisible());
+ Assert.assertEquals(true, glWindow1.isVisible());
+ break;
+
+ case 5:
+ // glWindow2 -- child --> glWindow1: compatible
Assert.assertEquals(true, glWindow2.isVisible());
reparentAction = glWindow2.reparentWindow(glWindow1, -1, -1, reparentHints);
Assert.assertTrue(Window.ReparentOperation.ACTION_INVALID != reparentAction);