diff options
Diffstat (limited to 'src/native')
-rw-r--r-- | src/native/newt/MacWindow.m | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/native/newt/MacWindow.m b/src/native/newt/MacWindow.m index aa09486bf..701187b2a 100644 --- a/src/native/newt/MacWindow.m +++ b/src/native/newt/MacWindow.m @@ -44,6 +44,25 @@ #import <stdio.h> +// For some reason, rightMouseDown isn't automatically being passed +// from the NSView to the containing NSWindow + +@interface NewtView : NSView +{ +} + +@end + +@implementation NewtView +- (void) rightMouseDown: (NSEvent*) theEvent +{ + NSResponder* next = [self nextResponder]; + if (next != nil) { + [next rightMouseDown: theEvent]; + } +} +@end + NSString* jstringToNSString(JNIEnv* env, jstring jstr) { const jchar* jstrChars = (*env)->GetStringChars(env, jstr, NULL); @@ -121,7 +140,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_createWindow setFrameTopLeftPoint(window, x, y); // Allocate an NSView - NSView* view = [[NSView alloc] initWithFrame: rect]; + NSView* view = [[NewtView alloc] initWithFrame: rect]; // specify we want mouse-moved events [window setAcceptsMouseMovedEvents:YES]; @@ -129,6 +148,10 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_createWindow // Set the content view [window setContentView: view]; + // Set the next responder to be the window so that we can forward + // right mouse button down events + [view setNextResponder: window]; + [pool release]; return (jlong) ((intptr_t) window); |