Skip to content

Commit 822ee47

Browse files
committed
8257242: [macOS] Java app crashes while switching input methods
Reviewed-by: serb
1 parent 7d89852 commit 822ee47

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.h

-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737

3838
// TODO: NSMenu *contextualMenu;
3939

40-
// Keyboard layout
41-
NSString *kbdLayout;
42-
4340
// dnd support (see AppKit/NSDragging.h, NSDraggingSource/Destination):
4441
CDragSource *_dragSource;
4542
CDropTarget *_dropTarget;

src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m

+5-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
#import <Carbon/Carbon.h>
3737
#import <JavaNativeFoundation/JavaNativeFoundation.h>
3838

39+
// keyboard layout
40+
static NSString *kbdLayout;
41+
3942
@interface AWTView()
4043
@property (retain) CDropTarget *_dropTarget;
4144
@property (retain) CDragSource *_dragSource;
@@ -994,7 +997,7 @@ - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange
994997
[self abandonInput];
995998
}
996999

997-
- (void)keyboardInputSourceChanged:(NSNotification *)notification
1000+
+ (void)keyboardInputSourceChanged:(NSNotification *)notification
9981001
{
9991002
#ifdef IM_DEBUG
10001003
NSLog(@"keyboardInputSourceChangeNotification received");
@@ -1291,7 +1294,7 @@ static JNF_MEMBER_CACHE(jm_characterIndexForPoint, jc_CInputMethod,
12911294
jint index = JNFCallIntMethod(env, fInputMethodLOCKABLE, jm_characterIndexForPoint, (jint)flippedLocation.x, (jint)flippedLocation.y); // AWT_THREADING Safe (AWTRunLoopMode)
12921295

12931296
#ifdef IM_DEBUG
1294-
fprintf(stderr, "characterIndexForPoint returning %ld\n", index);
1297+
fprintf(stderr, "characterIndexForPoint returning %d\n", index);
12951298
#endif // IM_DEBUG
12961299

12971300
if (index == -1) {

0 commit comments

Comments
 (0)