aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/newt/classes/com/jogamp/newt/Window.java28
-rw-r--r--src/newt/classes/jogamp/newt/WindowImpl.java30
-rw-r--r--src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java25
4 files changed, 33 insertions, 52 deletions
diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java
index 51395602c..cacac9f9b 100644
--- a/src/newt/classes/com/jogamp/newt/Window.java
+++ b/src/newt/classes/com/jogamp/newt/Window.java
@@ -369,20 +369,20 @@ public interface Window extends NativeWindow, WindowClosingProtocol, ScalableSur
* <p>
* Semantic of the supported state-mask bits:
* <ul>
- * <li>{@link #STATE_BIT_VISIBLE}: {@link #setVisible(boolean) Visibility} can be toggled after creation. <b>Minimum requirement</b>.</li>
- * <li>{@link #STATE_BIT_AUTOPOSITION}: {@code WindowManager autoposition} is supported.</li>
- * <li>{@link #STATE_BIT_CHILDWIN}: {@link #reparentWindow(NativeWindow, int, int, int) Native window parenting} is supported.</li>
- * <li>{@link #STATE_BIT_FOCUSED}: Window {@link #requestFocus() focus management} is supported. <b>Minimum requirement</b>.</li>
- * <li>{@link #STATE_BIT_UNDECORATED}: {@link #setUndecorated(boolean) Window decoration} can be toggled after creation.</li>
- * <li>{@link #STATE_BIT_ALWAYSONTOP}: Window can be set {@link #setAlwaysOnTop(boolean) always-on-top}. </li>
- * <li>{@link #STATE_BIT_ALWAYSONBOTTOM}: Window can be set {@link #setAlwaysOnBottom(boolean) always-on-bottom}. </li>
- * <li>{@link #STATE_BIT_STICKY}: Window can be set {@link #setSticky(boolean) sticky}.</li>
- * <li>{@link #STATE_BIT_RESIZABLE}: Window {@link #setResizable(boolean) resizability} can be disabled and toggled.</li>
- * <li>{@link #STATE_BIT_MAXIMIZED_VERT}: Window can be {@link #setMaximized(boolean, boolean) maximized-vertically}. </li>
- * <li>{@link #STATE_BIT_MAXIMIZED_HORZ}: Window can be {@link #setMaximized(boolean, boolean) maximized-horizontally}. </li>
- * <li>{@link #STATE_BIT_FULLSCREEN}: Window {@link #setFullscreen(boolean) fullscreen} can be toggled after creation. </li>
- * <li>{@link #STATE_BIT_POINTERVISIBLE}: Window {@link #setPointerVisible(boolean) pointer visibility} can be toggled. </li>
- * <li>{@link #STATE_BIT_POINTERCONFINED}: Window {@link #confinePointer(boolean) pointer can be confined}. </li>
+ * <li>{@link #STATE_MASK_VISIBLE}: {@link #setVisible(boolean) Visibility} can be toggled after creation. <b>Minimum requirement</b>.</li>
+ * <li>{@link #STATE_MASK_AUTOPOSITION}: {@code WindowManager autoposition} is supported.</li>
+ * <li>{@link #STATE_MASK_CHILDWIN}: {@link #reparentWindow(NativeWindow, int, int, int) Native window parenting} is supported.</li>
+ * <li>{@link #STATE_MASK_FOCUSED}: Window {@link #requestFocus() focus management} is supported. <b>Minimum requirement</b>.</li>
+ * <li>{@link #STATE_MASK_UNDECORATED}: {@link #setUndecorated(boolean) Window decoration} can be toggled after creation.</li>
+ * <li>{@link #STATE_MASK_ALWAYSONTOP}: Window can be set {@link #setAlwaysOnTop(boolean) always-on-top}. </li>
+ * <li>{@link #STATE_MASK_ALWAYSONBOTTOM}: Window can be set {@link #setAlwaysOnBottom(boolean) always-on-bottom}. </li>
+ * <li>{@link #STATE_MASK_STICKY}: Window can be set {@link #setSticky(boolean) sticky}.</li>
+ * <li>{@link #STATE_MASK_RESIZABLE}: Window {@link #setResizable(boolean) resizability} can be disabled and toggled.</li>
+ * <li>{@link #STATE_MASK_MAXIMIZED_VERT}: Window can be {@link #setMaximized(boolean, boolean) maximized-vertically}. </li>
+ * <li>{@link #STATE_MASK_MAXIMIZED_HORZ}: Window can be {@link #setMaximized(boolean, boolean) maximized-horizontally}. </li>
+ * <li>{@link #STATE_MASK_FULLSCREEN}: Window {@link #setFullscreen(boolean) fullscreen} can be toggled after creation. </li>
+ * <li>{@link #STATE_MASK_POINTERVISIBLE}: Window {@link #setPointerVisible(boolean) pointer visibility} can be toggled. </li>
+ * <li>{@link #STATE_MASK_POINTERCONFINED}: Window {@link #confinePointer(boolean) pointer can be confined}. </li>
* </ul>
* </p>
* @see #getStateMask()
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index b6e2a1dea..1f91a759c 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -223,7 +223,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
/**
* Reconfig mask for createNativeImpl(..) taking out from {@link #getStateMask()}:
* <ul>
- * <li>{@link #STATE_MASK_VISIBLE}</li>
* <li>{@link #STATE_MASK_FULLSCREEN}</li>
* <li>{@link #STATE_MASK_POINTERVISIBLE}</li>
* <li>{@link #STATE_MASK_POINTERCONFINED}</li>
@@ -231,13 +230,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* Above taken out states are achieved from caller createNative() 'manually'.
* @since 2.3.2
*/
- protected final int STATE_MASK_CREATENATIVE = STATE_MASK_UNDECORATED |
- STATE_MASK_ALWAYSONTOP |
- STATE_MASK_ALWAYSONBOTTOM |
- STATE_MASK_STICKY |
- STATE_MASK_RESIZABLE |
- STATE_MASK_MAXIMIZED_VERT |
- STATE_MASK_MAXIMIZED_HORZ;
+ protected final int STATE_MASK_CREATENATIVE = STATE_MASK_ALL_PUBLIC &
+ ~( STATE_MASK_FULLSCREEN |
+ STATE_MASK_POINTERVISIBLE |
+ STATE_MASK_POINTERCONFINED
+ );
//
// Additional private state-mask mask values for reconfiguration only
// (keep in sync w/ src/newt/native/Window.h)
@@ -262,12 +259,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
/* pp */ final void resetStateMask() {
stateMask.clearField(false);
- stateMask.set(STATE_BIT_AUTOPOSITION);
- stateMask.put(STATE_BIT_CHILDWIN, null != parentWindow);
- stateMask.set(STATE_BIT_RESIZABLE);
- stateMask.set(STATE_BIT_POINTERVISIBLE);
- stateMask.set(PSTATE_BIT_FULLSCREEN_NFS_RESIZABLE);
- stateMask.set(PSTATE_BIT_FULLSCREEN_MAINMONITOR);
+ stateMask.put32(0, 32,
+ STATE_MASK_AUTOPOSITION |
+ ( null != parentWindow ? STATE_MASK_CHILDWIN : 0 ) |
+ STATE_MASK_RESIZABLE |
+ STATE_MASK_POINTERVISIBLE |
+ PSTATE_MASK_FULLSCREEN_NFS_RESIZABLE |
+ PSTATE_MASK_FULLSCREEN_MAINMONITOR);
normPosSizeStored[0] = false;
normPosSizeStored[1] = false;
supportedReconfigStateMask = STATE_MASK_ALL_RECONFIG;
@@ -2917,7 +2915,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
final int changeMask;
try {
{
- // Enter fullscreen - Disable alwaysOnTop/alwaysOnBottom/resizableChange
+ // Enter fullscreen - Disable alwaysOnTop/resizableChange
int cm = 0;
if( alwaysOnTopChange ) {
cm = CHANGE_MASK_ALWAYSONTOP;
@@ -2928,7 +2926,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
changeMask = cm;
}
if( _fullscreen && 0 != changeMask ) {
- // Enter fullscreen - Disable alwaysOnTop/alwaysOnBottom/resizableChange
+ // Enter fullscreen - Disable alwaysOnTop/resizableChange
reconfigureWindowImpl(oldX, oldY, oldWidth, oldHeight, getReconfigureMask(changeMask, isVisible()));
}
diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
index f29ee4bf5..70a8ec558 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
@@ -207,7 +207,7 @@ public class WindowDriver extends WindowImpl {
STATE_MASK_UNDECORATED |
STATE_MASK_ALWAYSONTOP |
STATE_MASK_ALWAYSONBOTTOM |
- STATE_MASK_STICKY |
+ // STATE_MASK_STICKY |
STATE_MASK_RESIZABLE |
STATE_MASK_MAXIMIZED_VERT |
STATE_MASK_MAXIMIZED_HORZ |
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java
index 0f3011c3d..17e50adc0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java
@@ -28,10 +28,9 @@
package com.jogamp.opengl.test.junit.jogl.demos.gl2.newt;
-import com.jogamp.newt.event.KeyAdapter;
-import com.jogamp.newt.event.KeyEvent;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.test.junit.util.NEWTDemoListener;
import com.jogamp.opengl.test.junit.util.QuitAdapter;
import com.jogamp.opengl.util.Animator;
@@ -84,25 +83,9 @@ public class TestGearsNEWT extends UITestCase {
glWindow.addKeyListener(quitAdapter);
glWindow.addWindowListener(quitAdapter);
- final GLWindow f_glWindow = glWindow;
- glWindow.addKeyListener(new KeyAdapter() {
- public void keyReleased(final KeyEvent e) {
- if( !e.isPrintableKey() || e.isAutoRepeat() ) {
- return;
- }
- if(e.getKeyChar()=='f') {
- new Thread() {
- public void run() {
- f_glWindow.setFullscreen(!f_glWindow.isFullscreen());
- } }.start();
- } else if(e.getKeyChar()=='d') {
- new Thread() {
- public void run() {
- f_glWindow.setUndecorated(!f_glWindow.isUndecorated());
- } }.start();
- }
- }
- });
+ final NEWTDemoListener newtDemoListener = new NEWTDemoListener(glWindow);
+ glWindow.addKeyListener(newtDemoListener);
+ glWindow.addMouseListener(newtDemoListener);
glWindow.setSize(width, height);
glWindow.setVisible(true);