summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-12-08 19:04:45 +0100
committerSven Gothel <[email protected]>2019-12-08 19:04:45 +0100
commit5047217ff8366b0d3280e478aac6c711170d7063 (patch)
tree48fa197599ae1123ab6cb37bef8b43278acb4677
parent12eed5d38616d23b6e8e2e5b497dfc2f54d90c90 (diff)
Bug 1393: Apply 12eed5d38616d23b6e8e2e5b497dfc2f54d90c90 to IOS, avoiding AppKit/EDT deadlock for parent screen location lookup
-rw-r--r--src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java
index f84afc8f8..38cb79fa5 100644
--- a/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java
@@ -455,7 +455,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
OSXUtil.RunOnMainThread(false, false, new Runnable() {
@Override
public void run() {
- updateSizePosInsets0(getWindowHandle(), false);
+ updateSizePosInsets0(getWindowHandle(), false); // calls: sizeScreenPosInsetsChanged(..)
} } );
}
visibleChanged(0 != ( STATE_MASK_VISIBLE & flags));
@@ -475,7 +475,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
OSXUtil.RunOnMainThread(false, false, new Runnable() {
@Override
public void run() {
- updateSizePosInsets0(oldWindowHandle, false);
+ updateSizePosInsets0(oldWindowHandle, false); // calls: sizeScreenPosInsetsChanged(..)
} } );
} else { // else offscreen size is realized via recreation
// no native event (fullscreen, some reparenting)
@@ -522,7 +522,8 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
}
private Point getLocationOnScreenByParent(final int x, final int y, final NativeWindow parent) {
- return new Point(x, y).translate( parent.getLocationOnScreen(null) );
+ // return new Point(x, y).translate( parent.getLocationOnScreen(null) ); // Bug 1393: deadlock AppKit + EDT
+ return new Point(x, y).translate( IOSUtil.GetLocationOnScreen(parent.getWindowHandle(), 0, 0) ); // non-blocking
}
/** Callback for native screen position change event of the client area. */
@@ -540,7 +541,8 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
public void run() {
// screen position -> rel child window position
final Point absPos = new Point(newX, newY);
- final Point parentOnScreen = parent.getLocationOnScreen(null);
+ // final Point parentOnScreen = parent.getLocationOnScreen(null); // Bug 1393: deadlock AppKit + EDT
+ final Point parentOnScreen = IOSUtil.GetLocationOnScreen(parent.getWindowHandle(), 0, 0); // non-blocking
absPos.translate( parentOnScreen.scale(-1, -1) );
if(DEBUG_IMPLEMENTATION) {
System.err.println("MacWindow.positionChanged.1 (Screen Pos - CHILD): ("+getThreadName()+"): (defer: "+defer+") "+getX()+"/"+getY()+" -> absPos "+newX+"/"+newY+", parentOnScreen "+parentOnScreen+" -> "+absPos);