Skip to content
Permalink
Browse files
8257242: [macOS] Java app crashes while switching input methods
Backport-of: 822ee47
  • Loading branch information
Olga Mikhaltsova authored and Yuri Nesterenko committed Dec 23, 2020
1 parent 9db1121 commit ea904d8c2d917efbaa8e1840696d55eaac690460
@@ -37,9 +37,6 @@

// TODO: NSMenu *contextualMenu;

// Keyboard layout
NSString *kbdLayout;

// dnd support (see AppKit/NSDragging.h, NSDraggingSource/Destination):
CDragSource *_dragSource;
CDropTarget *_dropTarget;
@@ -37,6 +37,9 @@
#import <Carbon/Carbon.h>
#import <JavaNativeFoundation/JavaNativeFoundation.h>

// keyboard layout
static NSString *kbdLayout;

@interface AWTView()
@property (retain) CDropTarget *_dropTarget;
@property (retain) CDragSource *_dragSource;
@@ -998,7 +1001,7 @@ - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange
[self abandonInput];
}

- (void)keyboardInputSourceChanged:(NSNotification *)notification
+ (void)keyboardInputSourceChanged:(NSNotification *)notification
{
#ifdef IM_DEBUG
NSLog(@"keyboardInputSourceChangeNotification received");
@@ -1295,7 +1298,7 @@ static JNF_MEMBER_CACHE(jm_characterIndexForPoint, jc_CInputMethod,
jint index = JNFCallIntMethod(env, fInputMethodLOCKABLE, jm_characterIndexForPoint, (jint)flippedLocation.x, (jint)flippedLocation.y); // AWT_THREADING Safe (AWTRunLoopMode)

#ifdef IM_DEBUG
fprintf(stderr, "characterIndexForPoint returning %ld\n", index);
fprintf(stderr, "characterIndexForPoint returning %d\n", index);
#endif // IM_DEBUG

if (index == -1) {

1 comment on commit ea904d8

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on ea904d8 Dec 23, 2020

Please sign in to comment.