删除主动增加的38px的y轴偏移量

通过Kylin SDK获取的窗口坐标会考虑窗口是否启用了标题栏,
并根据是否存在标题栏返回相应的窗口坐标。可以简单的理解为
窗口坐标指的是不包含标题栏的窗口左上角的坐标。因此,不再
需要表示标题栏高度的38px了。这样的话,可以避免在应用程序
禁用了窗口标题栏后输入窗口偏下的问题
This commit is contained in:
liulinsong 2024-06-20 14:53:59 +08:00 committed by niushijia
parent 016fed13cf
commit 2450f9dede
1 changed files with 2 additions and 2 deletions

View File

@ -601,7 +601,7 @@ void QFcitxPlatformInputContext::cursorRectChanged() {
data.rect = r; data.rect = r;
if (QGuiApplication::platformName().startsWith("wayland") && lastWindowId_.isValid()) { if (QGuiApplication::platformName().startsWith("wayland") && lastWindowId_.isValid()) {
QRect windowGeometry = kdk::WindowManager::windowGeometry(lastWindowId_); QRect windowGeometry = kdk::WindowManager::windowGeometry(lastWindowId_);
proxy->setCursorRectV2(windowGeometry.x() + r.x(), windowGeometry.y() + r.y() + 38, r.width(), r.height(), scale); proxy->setCursorRectV2(windowGeometry.x() + r.x(), windowGeometry.y() + r.y(), r.width(), r.height(), scale);
} else { } else {
proxy->setCursorRectV2(r.x(), r.y(), r.width(), r.height(), scale); proxy->setCursorRectV2(r.x(), r.y(), r.width(), r.height(), scale);
} }
@ -619,7 +619,7 @@ void QFcitxPlatformInputContext::cursorRectChanged() {
data.rect = newRect; data.rect = newRect;
if (QGuiApplication::platformName().startsWith("wayland") && lastWindowId_.isValid()) { if (QGuiApplication::platformName().startsWith("wayland") && lastWindowId_.isValid()) {
QRect windowGeometry = kdk::WindowManager::windowGeometry(lastWindowId_); QRect windowGeometry = kdk::WindowManager::windowGeometry(lastWindowId_);
proxy->setCursorRect(windowGeometry.x() + newRect.x(), windowGeometry.y() + newRect.y() + 38, newRect.width(), proxy->setCursorRect(windowGeometry.x() + newRect.x(), windowGeometry.y() + newRect.y(), newRect.width(),
newRect.height()); newRect.height());
} else { } else {
proxy->setCursorRect(newRect.x(), newRect.y(), newRect.width(), proxy->setCursorRect(newRect.x(), newRect.y(), newRect.width(),