diff options
author | Sven Gothel <[email protected]> | 2015-11-15 04:34:51 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-11-15 04:34:51 +0100 |
commit | 2fa50b55b2459fee19338fcf4f5666577b25ca7d (patch) | |
tree | 60fe6c0eb5a3465be0ff49bd680f8888097fdc4a /src/newt/classes/jogamp | |
parent | 583c8c525b0691a0cb2a195ced20969b2e0ff57f (diff) |
Bug 1267 - OSX El Capitan: Animated NEWT GLWindow flickers at resize
OSX El Capitan 10.11.1 using JRE 1.8.0_66:
Animated NEWT GLWindow flickers at resize.
While at live resize the animation thread renders
into the live resized NSView which causes flickering on OSX 10.11.
Resolution is to pause animation during live resize
and resume at its end.
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r-- | src/newt/classes/jogamp/newt/WindowImpl.java | 1 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java | 16 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 88f9e07b9..0d395b970 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -3275,6 +3275,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener if(animatorPaused) { lifecycleHook.resumeRenderingAction(); + animatorPaused = false; } if( hadFocus ) { requestFocus(true); diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java index a433ef382..46c86d2c1 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java @@ -211,6 +211,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl surfaceHandle = 0; sscSurfaceHandle = 0; isOffscreenInstance = false; + resizeAnimatorPaused = false; if (0 != handle) { OSXUtil.RunOnMainThread(false, true /* kickNSApp */, new Runnable() { @Override @@ -593,10 +594,21 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl final int newX, final int newY, final int newWidth, final int newHeight, final int left, final int right, final int top, final int bottom, - final boolean force) { + final boolean force, + final boolean withinLiveResize) { + final LifecycleHook lh = getLifecycleHook(); + if( withinLiveResize && !resizeAnimatorPaused && null!=lh ) { + resizeAnimatorPaused = lh.pauseRenderingAction(); + } sizeChanged(defer, newWidth, newHeight, force); screenPositionChanged(defer, newX, newY); insetsChanged(defer, left, right, top, bottom); + if( !withinLiveResize && resizeAnimatorPaused ) { + resizeAnimatorPaused = false; + if( null!=lh ) { + lh.resumeRenderingAction(); + } + } } @Override @@ -847,5 +859,5 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl private volatile long surfaceHandle = 0; private long sscSurfaceHandle = 0; private boolean isOffscreenInstance = false; - + private boolean resizeAnimatorPaused = false; } |