删除主动增加的38px的y轴偏移量
通过Kylin SDK获取的窗口坐标会考虑窗口是否启用了标题栏, 并根据是否存在标题栏返回相应的窗口坐标。可以简单的理解为 窗口坐标指的是不包含标题栏的窗口左上角的坐标。因此,不再 需要表示标题栏高度的38px了。这样的话,可以避免在应用程序 禁用了窗口标题栏后输入窗口偏下的问题
This commit is contained in:
parent
016fed13cf
commit
2450f9dede
|
@ -601,7 +601,7 @@ void QFcitxPlatformInputContext::cursorRectChanged() {
|
|||
data.rect = r;
|
||||
if (QGuiApplication::platformName().startsWith("wayland") && lastWindowId_.isValid()) {
|
||||
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 {
|
||||
proxy->setCursorRectV2(r.x(), r.y(), r.width(), r.height(), scale);
|
||||
}
|
||||
|
@ -619,7 +619,7 @@ void QFcitxPlatformInputContext::cursorRectChanged() {
|
|||
data.rect = newRect;
|
||||
if (QGuiApplication::platformName().startsWith("wayland") && lastWindowId_.isValid()) {
|
||||
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());
|
||||
} else {
|
||||
proxy->setCursorRect(newRect.x(), newRect.y(), newRect.width(),
|
||||
|
|
Loading…
Reference in New Issue