From c4597b3a80f9fcbf89640bb007bc9004c361b6c7 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 16 Apr 2012 21:01:26 +0200 Subject: NEWT WindowImpl: Ensure screenChange suspense animation, even w/o having the notify method being called. This happens on android, where we just react on an already happened screen rotate. W/o animation suspend GL rendering could be disturbed or the thread could starve. --- src/newt/classes/jogamp/newt/WindowImpl.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/newt/classes') diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 1ef665571..f82f4b7d4 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -1853,6 +1853,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer } if(success) { + if(!animatorPaused && null!=lifecycleHook) { + // Didn't pass above notify method. probably detected screen change after it happened. + animatorPaused = lifecycleHook.pauseRenderingAction(); + } DimensionImmutable screenSize = sm.getMonitorMode().getSurfaceSize().getResolution(); if ( getHeight() > screenSize.getHeight() || getWidth() > screenSize.getWidth() ) { -- cgit v1.2.3