Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
/ jdk13u-dev Public archive

Commit ea904d8

Browse files
Olga MikhaltsovaYuri Nesterenko
Olga Mikhaltsova
authored and
Yuri Nesterenko
committed
8257242: [macOS] Java app crashes while switching input methods
Backport-of: 822ee47
1 parent 9db1121 commit ea904d8

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
@@ -37,6 +37,9 @@
3737
#import <Carbon/Carbon.h>
3838
#import <JavaNativeFoundation/JavaNativeFoundation.h>
3939

40+
// keyboard layout
41+
static NSString *kbdLayout;
42+
4043
@interface AWTView()
4144
@property (retain) CDropTarget *_dropTarget;
4245
@property (retain) CDragSource *_dragSource;
@@ -998,7 +1001,7 @@ - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange
9981001
[self abandonInput];
9991002
}
10001003

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

12971300
#ifdef IM_DEBUG
1298-
fprintf(stderr, "characterIndexForPoint returning %ld\n", index);
1301+
fprintf(stderr, "characterIndexForPoint returning %d\n", index);
12991302
#endif // IM_DEBUG
13001303

13011304
if (index == -1) {

0 commit comments

Comments
 (0)