diff --git a/modules/juce_gui_basics/native/juce_Windowing_windows.cpp b/modules/juce_gui_basics/native/juce_Windowing_windows.cpp index cafc6a727b..bf8d63c3fa 100644 --- a/modules/juce_gui_basics/native/juce_Windowing_windows.cpp +++ b/modules/juce_gui_basics/native/juce_Windowing_windows.cpp @@ -4586,9 +4586,10 @@ private: { if (auto* targetComp = dynamic_cast (target)) { - auto area = peer.getComponent().getLocalArea (targetComp, target->getCaretRectangle()); + const auto screenPos = targetComp->localPointToGlobal (target->getCaretRectangle().getBottomLeft()); + const auto relativePos = peer.globalToLocal (screenPos) * peer.getPlatformScaleFactor(); - CANDIDATEFORM pos = { 0, CFS_CANDIDATEPOS, { area.getX(), area.getBottom() }, { 0, 0, 0, 0 } }; + CANDIDATEFORM pos { 0, CFS_CANDIDATEPOS, D2DUtilities::toPOINT (relativePos), { 0, 0, 0, 0 } }; ImmSetCandidateWindow (hImc, &pos); } }