From e7bb03d8e7bee64530b8b6a39dc03967b7214e71 Mon Sep 17 00:00:00 2001 From: Yoshiki Shibukawa Date: Fri, 26 Feb 2016 10:46:49 +0100 Subject: [PATCH] Improve OS X IME candidate window placement --- README.md | 1 + src/cocoa_window.m | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f047947..9d9001b3 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,7 @@ skills. - SephiRok - Steve Sexton - Systemcluster + - Yoshiki Shibukawa - Dmitri Shuralyov - Daniel Skorupski - Bradley Smith diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 6bcacba0..c53ec24a 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -662,7 +662,10 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; - (NSRect)firstRectForCharacterRange:(NSRange)range actualRange:(NSRangePointer)actualRange { - return NSMakeRect(0, 0, 0, 0); + int x, y; + _glfwPlatformGetWindowPos(window, &x, &y); + const NSRect contentRect = [window->ns.view frame]; + return NSMakeRect(x, transformY(y+contentRect.size.height), 0, 0); } - (void)insertText:(id)string replacementRange:(NSRange)replacementRange