diff options
author | Sven Gothel <[email protected]> | 2013-10-09 01:53:53 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-10-09 01:53:53 +0200 |
commit | 88291cd5e20fc8b172f1d78a683be7d2bdec807a (patch) | |
tree | 2aeaf6c0834e9b3649c52f17e7fa9d572ba940cf /src | |
parent | c2a4905ec926362a08f486a68d428fb139821df1 (diff) |
NEWT/OSX (Bug 836): Only WindowDriver.initWindow0(..) operation on main-thread must be synchronized (wait-until-done)
- Leave WindowDriver.close0(..) w/o sync
Diffstat (limited to 'src')
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java index d973c9005..08638d868 100644 --- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java @@ -86,7 +86,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl sscSurfaceHandle = 0; isOffscreenInstance = false; if (0 != handle) { - OSXUtil.RunOnMainThread(true, new Runnable() { + OSXUtil.RunOnMainThread(false, new Runnable() { public void run() { close0( handle ); } } ); @@ -159,14 +159,17 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl @Override protected void setTitleImpl(final String title) { - OSXUtil.RunOnMainThread(false, new Runnable() { - public void run() { - setTitle0(getWindowHandle(), title); - } } ); + OSXUtil.RunOnMainThread(false, new Runnable() { + public void run() { + setTitle0(getWindowHandle(), title); + } } ); } @Override protected void requestFocusImpl(final boolean force) { + if(DEBUG_IMPLEMENTATION) { + System.err.println("MacWindow: requestFocusImpl(), isOffscreenInstance "+isOffscreenInstance); + } if(!isOffscreenInstance) { OSXUtil.RunOnMainThread(false, new Runnable() { public void run() { @@ -414,13 +417,15 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl short _keySym = KeyEvent.NULL_CHAR != keySymChar ? KeyEvent.utf16ToVKey(keySymChar) : KeyEvent.VK_UNDEFINED; keySym = KeyEvent.VK_UNDEFINED != _keySym ? _keySym : keyCode; } - /* { + /** + { final boolean isModifierKeyCode = KeyEvent.isModifierKey(keyCode); System.err.println("*** handleKeyEvent: event "+KeyEvent.getEventTypeString(eventType)+ ", keyCode 0x"+Integer.toHexString(_keyCode)+" -> 0x"+Integer.toHexString(keyCode)+ ", keySymChar '"+keySymChar+"', 0x"+Integer.toHexString(keySymChar)+" -> 0x"+Integer.toHexString(keySym)+ ", mods "+toHexString(modifiers)+ - ", was: pressed "+isKeyPressed(keyCode)+", isModifierKeyCode "+isModifierKeyCode); + ", was: pressed "+isKeyPressed(keyCode)+", isModifierKeyCode "+isModifierKeyCode+ + ", nativeValid "+isNativeValid()+", isOffscreen "+isOffscreenInstance); } */ // OSX delivery order is PRESSED (t0), RELEASED (t1) and TYPED (t2) -> NEWT order: PRESSED (t0) and RELEASED (t1) @@ -470,7 +475,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl if( 0 == surfaceHandle ) { throw new NativeWindowException("Internal Error - create w/ window, but no Newt NSView"); } - OSXUtil.RunOnMainThread(true, new Runnable() { + OSXUtil.RunOnMainThread(false, new Runnable() { public void run() { changeContentView0(parentWinHandle, preWinHandle, 0); close0( preWinHandle ); |