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

Commit 59f8941

Browse files
Olga MikhaltsovaYuri Nesterenko
Olga Mikhaltsova
authored and
Yuri Nesterenko
committed
8257242: [macOS] Java app crashes while switching input methods
Backport-of: 822ee47459d3a33ab3acd7f8798525967a20d237
1 parent 1abb26f commit 59f8941

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

3838
#import <Carbon/Carbon.h>
3939

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

1013-
- (void)keyboardInputSourceChanged:(NSNotification *)notification
1016+
+ (void)keyboardInputSourceChanged:(NSNotification *)notification
10141017
{
10151018
#ifdef IM_DEBUG
10161019
NSLog(@"keyboardInputSourceChangeNotification received");
@@ -1327,7 +1330,7 @@ - (NSUInteger)characterIndexForPoint:(NSPoint)thePoint
13271330
CHECK_EXCEPTION();
13281331

13291332
#ifdef IM_DEBUG
1330-
fprintf(stderr, "characterIndexForPoint returning %ld\n", index);
1333+
fprintf(stderr, "characterIndexForPoint returning %d\n", index);
13311334
#endif // IM_DEBUG
13321335

13331336
if (index == -1) {

0 commit comments

Comments
 (0)