From 25ea4438917832f0fb334b4f04a222452e2ecf8b Mon Sep 17 00:00:00 2001 From: Lukhnos Liu Date: Wed, 24 Nov 2021 23:22:29 -0800 Subject: [PATCH] Correctly locate a candidate panel's screen Previously only the x value was used to determine the screen to which a candidate panel should below. That was incorrect. The entire point needs to be considered. This fixes the same issue that affected OpenVanilla: https://github.com/openvanilla/openvanilla/issues/49 --- Source/CandidateUI/VTCandidateController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CandidateUI/VTCandidateController.m b/Source/CandidateUI/VTCandidateController.m index 5605ff71..933d1018 100644 --- a/Source/CandidateUI/VTCandidateController.m +++ b/Source/CandidateUI/VTCandidateController.m @@ -98,7 +98,7 @@ for (NSScreen *screen in [NSScreen screens]) { NSRect frame = [screen visibleFrame]; - if (topLeftPoint.x >= NSMinX(frame) && topLeftPoint.x <= NSMaxX(frame)) { + if (topLeftPoint.x >= NSMinX(frame) && topLeftPoint.x <= NSMaxX(frame) && topLeftPoint.y >= NSMinY(frame) && topLeftPoint.y <= NSMaxY(frame)) { screenFrame = frame; break; }