Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions jdk/src/macosx/native/sun/awt/AWTView.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
NSTrackingArea* rolloverTrackingArea;

// TODO: NSMenu *contextualMenu;

Check failure on line 40 in jdk/src/macosx/native/sun/awt/AWTView.h

View check run for this annotation

openjdk / jcheck-openjdk/jdk8u-dev-595

Whitespace error

Column 0: trailing whitespace Column 1: trailing whitespace Column 2: trailing whitespace Column 3: trailing whitespace
// Keyboard layout
NSString *kbdLayout;

// dnd support (see AppKit/NSDragging.h, NSDraggingSource/Destination):
CDragSource *_dragSource;
Expand Down
16 changes: 16 additions & 0 deletions jdk/src/macosx/native/sun/awt/AWTView.m
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,15 @@ - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange

}

- (void)keyboardInputSourceChanged:(NSNotification *)notification
{
#ifdef IM_DEBUG
NSLog(@"keyboardInputSourceChangeNotification received");
#endif
NSTextInputContext *curContxt = [NSTextInputContext currentInputContext];
kbdLayout = curContxt.selectedKeyboardInputSource;
}

- (void) doCommandBySelector:(SEL)aSelector
{
#ifdef IM_DEBUG
Expand Down Expand Up @@ -1330,6 +1339,13 @@ - (void)setInputMethod:(jobject)inputMethod
fInputMethodLOCKABLE = JNFNewGlobalRef(env, inputMethod);
else
fInputMethodLOCKABLE = NULL;

NSTextInputContext *curContxt = [NSTextInputContext currentInputContext];
kbdLayout = curContxt.selectedKeyboardInputSource;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardInputSourceChanged:)
name:NSTextInputContextKeyboardSelectionDidChangeNotification
object:nil];
}

- (void)abandonInput
Expand Down