Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuki Hashimoto <hzuika>2021-07-05 14:14:32 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-07-05 15:32:35 +0300
commit2d0b9faaf6ec63e6d782c09f6ebb4758737d7b8f (patch)
treeef4eeb6b4d70d3d08732236d2e0533b75980acc0
parent32124b940ee65b844a8a0e13ed0377e24c65fcc7 (diff)
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
-rw-r--r--source/blender/windowmanager/intern/wm_window.c4
1 files changed, 4 insertions, 0 deletions
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);
}