Skip to content

Commit

Permalink
8195675: Call to insertText with single character from custom Input M…
Browse files Browse the repository at this point in the history
…ethod ignored

Backport-of: b8f2ec9091f9f7e5f4611991d04dd8aa113b94fd
  • Loading branch information
Steven Loomis committed Nov 1, 2024
1 parent 2a9bd22 commit 9ae66af
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
// keyboard layout
static NSString *kbdLayout;

// Constant for keyman layouts
#define KEYMAN_LAYOUT "keyman"

@interface AWTView()
@property (retain) CDropTarget *_dropTarget;
@property (retain) CDragSource *_dragSource;
Expand Down Expand Up @@ -259,7 +262,7 @@ - (void) scrollWheel: (NSEvent*) event {

- (void) keyDown: (NSEvent *)event {
fProcessingKeystroke = YES;
fKeyEventsNeeded = YES;
fKeyEventsNeeded = ![(NSString *)kbdLayout containsString:@KEYMAN_LAYOUT];

// Allow TSM to look at the event and potentially send back NSTextInputClient messages.
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
Expand Down Expand Up @@ -961,7 +964,7 @@ - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange

if ((utf16Length > 2) ||
((utf8Length > 1) && [self isCodePointInUnicodeBlockNeedingIMEvent:codePoint]) ||
((codePoint == 0x5c) && ([(NSString *)kbdLayout containsString:@"Kotoeri"]))) {
[(NSString *)kbdLayout containsString:@KEYMAN_LAYOUT]) {
aStringIsComplex = YES;
}

Expand Down

1 comment on commit 9ae66af

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.