1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Windows: Fix bug where IME displayed at incorrect location on scaled displays

This commit is contained in:
reuk 2024-11-28 20:43:04 +00:00
parent 038b0d6c9e
commit cfee7cfc93
No known key found for this signature in database

View file

@ -4586,9 +4586,10 @@ private:
{
if (auto* targetComp = dynamic_cast<Component*> (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);
}
}