diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index d9025ab..8a58e59 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -57,7 +57,7 @@ Name: qt5-qtbase Summary: Qt5 - QtBase components Version: 5.15.9 -Release: 1%{?dist} +Release: 2%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0 @@ -148,6 +148,9 @@ Patch101: qtbase-5.15.8-fix-missing-qtsan-include.patch # https://bugreports.qt.io/browse/QTBUG-112136 Patch102: qtbase-QTBUG-111994.patch Patch103: qtbase-QTBUG-112136.patch +# IBus input method cannot set panel position correctly with DPI scaling +# https://bugreports.qt.io/browse/QTBUG-103393 +Patch104: qtbase-QTBUG-103393.patch # Do not check any files in %%{_qt5_plugindir}/platformthemes/ for requires. # Those themes are there for platform integration. If the required libraries are @@ -396,7 +399,7 @@ Qt5 libraries used for drawing widgets and OpenGL items. ## upstream fixes -%patch50 -p1 -b .QT_VERSION_CHECK +%patch -P50 -p1 -b .QT_VERSION_CHECK # FIXME/TODO : rebase or drop -- rdieter #patch -P51 -p1 -b .hidpi_scale_at_192 %patch -P52 -p1 -b .moc_macros @@ -425,6 +428,7 @@ Qt5 libraries used for drawing widgets and OpenGL items. %patch -P101 -p1 %patch -P102 -p1 %patch -P103 -p1 +%patch -P104 -p1 # move some bundled libs to ensure they're not accidentally used pushd src/3rdparty @@ -1104,6 +1108,9 @@ fi %changelog +* Fri May 05 2023 Than Ngo - 5.15.9-2 +- backport, IBus input method cannot set panel position correctly with DPI scaling + * Tue Apr 11 2023 Jan Grulich - 5.15.9-1 - 5.15.9 diff --git a/qtbase-QTBUG-103393.patch b/qtbase-QTBUG-103393.patch new file mode 100644 index 0000000..d5603d8 --- /dev/null +++ b/qtbase-QTBUG-103393.patch @@ -0,0 +1,39 @@ +diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp +index 086025472640350341768efed5206b418f324460..49a44519b6aee8cae3c04265ab5065c99005d838 100644 +--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp ++++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp +@@ -222,10 +222,31 @@ void QIBusPlatformInputContext::cursorRectChanged() + QWindow *inputWindow = qApp->focusWindow(); + if (!inputWindow) + return; +- r.moveTopLeft(inputWindow->mapToGlobal(r.topLeft())); ++ if (!inputWindow->screen()) ++ return; ++ ++ if (QGuiApplication::platformName().startsWith("wayland"_L1)) { ++ auto margins = inputWindow->frameMargins(); ++ r.translate(margins.left(), margins.top()); ++ qreal scale = inputWindow->devicePixelRatio(); ++ QRect newRect = QRect(r.x() * scale, r.y() * scale, r.width() * scale, r.height() * scale); ++ if (debug) ++ qDebug() << "microFocus" << newRect; ++ d->context->SetCursorLocationRelative(newRect.x(), newRect.y(), ++ newRect.width(), newRect.height()); ++ return; ++ } ++ ++ // x11/xcb ++ auto screenGeometry = inputWindow->screen()->geometry(); ++ auto point = inputWindow->mapToGlobal(r.topLeft()); ++ qreal scale = inputWindow->devicePixelRatio(); ++ auto native = (point - screenGeometry.topLeft()) * scale + screenGeometry.topLeft(); ++ QRect newRect(native, r.size() * scale); + if (debug) +- qDebug() << "microFocus" << r; +- d->context->SetCursorLocation(r.x(), r.y(), r.width(), r.height()); ++ qDebug() << "microFocus" << newRect; ++ d->context->SetCursorLocation(newRect.x(), newRect.y(), ++ newRect.width(), newRect.height()); + } + + void QIBusPlatformInputContext::setFocusObject(QObject *object)