From 9502408f3e20050cfdbb2f0529a2dce65a858ddf Mon Sep 17 00:00:00 2001 From: liulinsong Date: Tue, 11 Jun 2024 15:44:56 +0800 Subject: [PATCH] Ensure that the left of the input window is always visible The priority of the candidate words in the left of the input window is higher than those in the right. So it's more intuitive to ensure that the left of the input window is always visible. --- src/ui/classic/xcbinputwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ui/classic/xcbinputwindow.cpp b/src/ui/classic/xcbinputwindow.cpp index 3513464a0..93c3b55c8 100644 --- a/src/ui/classic/xcbinputwindow.cpp +++ b/src/ui/classic/xcbinputwindow.cpp @@ -74,6 +74,8 @@ int XCBInputWindow::calculatePositionX(const Rect &cursorRect, if (newX + actualWidth > closestScreen->right()) { newX = closestScreen->right() - actualWidth; } + + x = std::max(newX, closestScreen->left()); } // exclude shadow border width