diff options
author | Sven Gothel <[email protected]> | 2010-09-26 04:19:11 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-09-26 04:19:11 +0200 |
commit | 609e30836d4fcc5d2da945bf1c7d1d9a9c349b2a (patch) | |
tree | 70216c951469fb5389596f3e994f4348d399cbeb /src/newt | |
parent | 0d073c5ea4426b0139409b20a3879b6003f795b0 (diff) |
NEWT: Add Window.hasFocus() ; Test cleanup ..
- Window add focus tracking and query via hasFocus()
- TestTransformFeedbackVeryingsBug407NEWT allow fail if no GL3 is available
- TestFocus01SwingAWT check on NEWTChild focus
Diffstat (limited to 'src/newt')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/Window.java | 2 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/impl/WindowImpl.java | 8 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/opengl/GLWindow.java | 4 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java index ef3e5e69c..17a562d61 100644 --- a/src/newt/classes/com/jogamp/newt/Window.java +++ b/src/newt/classes/com/jogamp/newt/Window.java @@ -277,6 +277,8 @@ public interface Window extends NativeWindow { void requestFocus(); + boolean hasFocus(); + void windowRepaint(int x, int y, int width, int height); void enqueueEvent(boolean wait, com.jogamp.newt.event.NEWTEvent event); diff --git a/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java b/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java index d3ff2e558..e26947a36 100644 --- a/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java +++ b/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java @@ -170,7 +170,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer protected AbstractGraphicsConfiguration config; protected Capabilities caps; - protected boolean fullscreen, visible; + protected boolean fullscreen, visible, hasFocus; protected int width, height, x, y; // non fullscreen dimensions .. @@ -621,6 +621,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer windowHandle = 0; visible = false; fullscreen = false; + hasFocus = false; if(unrecoverable) { destroyScreen(); @@ -919,6 +920,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer enqueueRequestFocus(false); // FIXME: or shall we wait ? } + public boolean hasFocus() { + return hasFocus; + } + public Insets getInsets() { return new Insets(0,0,0,0); } @@ -1614,6 +1619,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer if(DEBUG_IMPLEMENTATION) { System.err.println("Window.focusChanged: ("+getThreadName()+"): "+focusGained+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle)); } + hasFocus = focusGained; if (focusGained) { sendWindowEvent(WindowEvent.EVENT_WINDOW_GAINED_FOCUS); } else { diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index 13d549e24..028f809f0 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -184,6 +184,10 @@ public class GLWindow implements GLAutoDrawable, Window { window.requestFocus(); } + public boolean hasFocus() { + return window.hasFocus(); + } + public final Insets getInsets() { return window.getInsets(); } |