Use the same logic from classicui for out of window positon.

This commit is contained in:
Weng Xuetian 2021-01-23 18:09:59 -08:00
parent ffefd6df93
commit a1fb000621
No known key found for this signature in database
GPG Key ID: 8E8B898CBF2412F9
1 changed files with 6 additions and 1 deletions

View File

@ -405,7 +405,12 @@ void fcitx::FcitxCandidateWindow::updateClientSideUI(
}
if (y + actualSize_.height() > screenGeometry.bottom()) {
y = cursorRect.top() - actualSize_.height() - 40;
if (y > screenGeometry.bottom()) {
y = screenGeometry.bottom() - actualSize_.height() - 40;
} else { /* better position the window */
y = y - actualSize_.height() -
((cursorRect.height() == 0) ? 40 : cursorRect.height());
}
}
if (y < screenGeometry.top()) {