diff options
author | Sven Gothel <[email protected]> | 2019-09-09 09:33:23 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-09-09 09:33:23 +0200 |
commit | e33aa16904d8abddaeceb1374ffa45bd45a96210 (patch) | |
tree | f8b563d5b4e6a0d788df6efc22c4deb4fe3c05e4 /src/newt/classes/jogamp | |
parent | b12a80e386b12d9d8fa63cf07124f8da989dcd04 (diff) |
Bug 1393: MacOS/iOS: Issue updateSizePosInsets0 async to AppKit Main-Thread
Additionally, setPointerIcon0 must also be made async on AppKit (instead of wait),
we have to assume/hope the user won't pull the PointerIconImpl instance in-between ;-)
Hence removing the comment regarding the lifecycle.
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java | 13 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java | 14 |
2 files changed, 22 insertions, 5 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java index b7ecc23d6..cc8a419d7 100644 --- a/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java @@ -41,6 +41,7 @@ import com.jogamp.nativewindow.util.PointImmutable; import jogamp.nativewindow.SurfaceScaleUtils; import jogamp.nativewindow.ios.IOSUtil; +import jogamp.nativewindow.macosx.OSXUtil; import jogamp.newt.ScreenImpl; import jogamp.newt.WindowImpl; import jogamp.newt.driver.DriverClearFocus; @@ -451,7 +452,11 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl super.sizeChanged(false, width, height, true); positionChanged(false, x, y); } else { - updateSizePosInsets0(getWindowHandle(), false); + OSXUtil.RunOnMainThread(false, false, new Runnable() { + @Override + public void run() { + updateSizePosInsets0(getWindowHandle(), false); + } } ); } visibleChanged(false, 0 != ( STATE_MASK_VISIBLE & flags)); if( hasFocus ) { @@ -467,7 +472,11 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl pClientLevelOnSreen.getX(), pClientLevelOnSreen.getY(), width, height, 0 != ( STATE_MASK_VISIBLE & flags)); } } ); - updateSizePosInsets0(oldWindowHandle, false); + OSXUtil.RunOnMainThread(false, false, new Runnable() { + @Override + public void run() { + updateSizePosInsets0(oldWindowHandle, false); + } } ); } else { // else offscreen size is realized via recreation // no native event (fullscreen, some reparenting) super.sizeChanged(false, width, height, false); diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java index 937c11a5c..bea07d976 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java @@ -457,7 +457,11 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl super.sizeChanged(false, width, height, true); positionChanged(false, x, y); } else { - updateSizePosInsets0(getWindowHandle(), false); + OSXUtil.RunOnMainThread(false, false, new Runnable() { + @Override + public void run() { + updateSizePosInsets0(getWindowHandle(), false); + } } ); } visibleChanged(false, 0 != ( STATE_MASK_VISIBLE & flags)); if( hasFocus ) { @@ -473,7 +477,11 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl pClientLevelOnSreen.getX(), pClientLevelOnSreen.getY(), width, height, 0 != ( STATE_MASK_VISIBLE & flags)); } } ); - updateSizePosInsets0(oldWindowHandle, false); + OSXUtil.RunOnMainThread(false, false, new Runnable() { + @Override + public void run() { + updateSizePosInsets0(oldWindowHandle, false); + } } ); } else { // else offscreen size is realized via recreation // no native event (fullscreen, some reparenting) super.sizeChanged(false, width, height, false); @@ -619,7 +627,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl protected void setPointerIconImpl(final PointerIconImpl pi) { if( !isOffscreenInstance ) { final long piHandle = null != pi ? pi.validatedHandle() : 0; - OSXUtil.RunOnMainThread(true, false, new Runnable() { // waitUntildone due to PointerIconImpl's Lifecycle ! + OSXUtil.RunOnMainThread(false, false, new Runnable() { @Override public void run() { setPointerIcon0(getWindowHandle(), piHandle); |