summaryrefslogtreecommitdiffstats
path: root/src/newt/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-12-08 09:44:35 +0100
committerSven Gothel <[email protected]>2019-12-08 09:44:35 +0100
commit12eed5d38616d23b6e8e2e5b497dfc2f54d90c90 (patch)
tree236ec2c72d90c82202653bb1949735bfa047e735 /src/newt/classes
parent5e6f75991d885f1e48760668f86b305824bd972a (diff)
Bug 1393: Resolve EDT + AppKit Deadlock with native parenting: Fetch parent screen position directly w/o locking.
Diffstat (limited to 'src/newt/classes')
-rw-r--r--src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
index 67cd188eb..2934375a3 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
@@ -460,7 +460,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
OSXUtil.RunOnMainThread(true, false, new Runnable() {
@Override
public void run() {
- updateSizePosInsets0(getWindowHandle(), false);
+ updateSizePosInsets0(getWindowHandle(), false); // calls: sizeScreenPosInsetsChanged(..)
} } );
}
visibleChanged(0 != ( STATE_MASK_VISIBLE & flags));
@@ -476,7 +476,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
setWindowClientTopLeftPointAndSize0(oldWindowHandle,
pClientLevelOnSreen.getX(), pClientLevelOnSreen.getY(),
width, height, 0 != ( STATE_MASK_VISIBLE & flags));
- updateSizePosInsets0(oldWindowHandle, false);
+ updateSizePosInsets0(oldWindowHandle, false); // calls: sizeScreenPosInsetsChanged(..)
} } );
} else { // else offscreen size is realized via recreation
// no native event (fullscreen, some reparenting)
@@ -523,7 +523,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( OSXUtil.GetLocationOnScreen(parent.getWindowHandle(), 0, 0) ); // non-blocking
}
/** Callback for native screen position change event of the client area. */
@@ -541,7 +542,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 = OSXUtil.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);