From 2d0b9faaf6ec63e6d782c09f6ebb4758737d7b8f Mon Sep 17 00:00:00 2001 From: Yuki Hashimoto Date: Mon, 5 Jul 2021 13:14:32 +0200 Subject: Fix: IME conversion candidate window not correctly placed on macOS Blender needs to tell the input method program where the conversion candidate window is during Japanese and Chinese input. In macOS, there are displays where the window size and the native pixel size are different, so the candidate window may appear in an unnatural position. This patch converts the cursor position x and y for matching macOS window coordinate. On Windows, GHOST_GetNativePixelSize returns 1, so it has no effect. Differential Revision: https://developer.blender.org/D11696 --- source/blender/windowmanager/intern/wm_window.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/windowmanager/intern/wm_window.c') diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index b61975e1b1a..954976fddb6 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -2403,6 +2403,10 @@ void wm_window_IME_begin(wmWindow *win, int x, int y, int w, int h, bool complet { BLI_assert(win); + /* Convert to native OS window coordinates. */ + float fac = GHOST_GetNativePixelSize(win->ghostwin); + x /= fac; + y /= fac; GHOST_BeginIME(win->ghostwin, x, win->sizey - y, w, h, complete); } -- cgit v1.2.3