diff options
author | Inho Lee <inho.lee@qt.io> | 2022-06-13 14:33:00 +0200 |
---|---|---|
committer | Inho Lee <inho.lee@qt.io> | 2022-08-23 12:02:40 +0200 |
commit | 22988ea1521598f6a12c1215aa7eaaf2c7659754 (patch) | |
tree | a9dd7c5fe92ffe48606137c0d7af2eab5ddab330 | |
parent | 5347a515744607c8574f13510d1665fd00d2c457 (diff) |
Remove platform-dependent codes for XCB6.3
Since 519cb821911681c837a02eb2fb2eddf7a43d967f,
DesktopInputPanel::updateInputRegion maintains a platform-dependent
implementation. However, it cannot handle a global scale factor
(QT_SCALE_FACTOR) correctly.
The main reason of the platform dependency was
Qt::X11BypassWindowManagerHint and it was removed already.
It seems to be safe to remove the platform-dependency here.
Fixes: QTBUG-94770
Change-Id: I3430b2c2ec9abe486f5660c3e61f26c6bfc34806
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
(cherry picked from commit 35235def29eeab80b2d1a6b89b3bfc6560bf13ef)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | src/virtualkeyboard/CMakeLists.txt | 11 | ||||
-rw-r--r-- | src/virtualkeyboard/configure.cmake | 11 | ||||
-rw-r--r-- | src/virtualkeyboard/desktopinputpanel.cpp | 49 |
3 files changed, 4 insertions, 67 deletions
diff --git a/src/virtualkeyboard/CMakeLists.txt b/src/virtualkeyboard/CMakeLists.txt index eaaa3f1b..9db7f73e 100644 --- a/src/virtualkeyboard/CMakeLists.txt +++ b/src/virtualkeyboard/CMakeLists.txt @@ -4,12 +4,6 @@ set(VKB_LAYOUTS_BASE "${CMAKE_CURRENT_SOURCE_DIR}" CACHE STRING "" FORCE) set(VKB_LAYOUTS_PREFIX "/QtQuick/VirtualKeyboard" CACHE STRING "" FORCE) set(VKB_INSTALL_DATA "${QT_INSTALL_DIR}/qtvirtualkeyboard" CACHE STRING "" FORCE) - -if(NOT TARGET XCB::XFIXES) - qt_find_package(XCB COMPONENTS XFIXES PROVIDED_TARGETS XCB::XFIXES - MODULE_NAME virtualkeyboard QMAKE_LIB xcb-xfixes - ) -endif() # special case end ##################################################################### @@ -684,11 +678,6 @@ qt_internal_extend_target(VirtualKeyboard CONDITION QT_FEATURE_vkb_desktop QT_VIRTUALKEYBOARD_DESKTOP ) -qt_internal_extend_target(VirtualKeyboard CONDITION QT_FEATURE_vkb_desktop AND QT_FEATURE_vkb_xcb - PUBLIC_LIBRARIES - XCB::XFIXES -) - qt_internal_extend_target(VirtualKeyboard CONDITION QT_FEATURE_vkb_record_trace_input SOURCES unipentrace.cpp unipentrace_p.h diff --git a/src/virtualkeyboard/configure.cmake b/src/virtualkeyboard/configure.cmake index 50b7556b..61890362 100644 --- a/src/virtualkeyboard/configure.cmake +++ b/src/virtualkeyboard/configure.cmake @@ -13,13 +13,6 @@ set(INPUT_vkb_cerence_sdk "" CACHE PATH "") #### Libraries qt_find_package(Hunspell PROVIDED_TARGETS Hunspell::Hunspell MODULE_NAME virtualkeyboard QMAKE_LIB hunspell) -if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS AND NOT TARGET XCB::XCB) # special case - qt_find_package(XCB 1.11 PROVIDED_TARGETS XCB::XCB MODULE_NAME virtualkeyboard QMAKE_LIB xcb) -endif() -if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS AND NOT TARGET XCB::XFIXES) # special case - qt_find_package(XCB COMPONENTS XFIXES PROVIDED_TARGETS XCB::XFIXES MODULE_NAME virtualkeyboard QMAKE_LIB xcb-xfixes) -endif() -qt_add_qmake_lib_dependency(xcb-xfixes xcb) qt_find_package(CerenceHwrAlphabetic PROVIDED_TARGETS Cerence::HWR::Alphabetic MODULE_NAME virtualkeyboard QMAKE_LIB t9write-ucr) qt_find_package(CerenceHwrCjk PROVIDED_TARGETS Cerence::HWR::CJK MODULE_NAME virtualkeyboard QMAKE_LIB t9write-cjk) qt_find_package(CerenceXt9 PROVIDED_TARGETS Cerence::XT9 MODULE_NAME virtualkeyboard QMAKE_LIB xt9-acktn) @@ -42,10 +35,6 @@ qt_feature("vkb-desktop" PUBLIC LABEL "Desktop integration" CONDITION NOT cross_compile ) -qt_feature("vkb-xcb" PUBLIC - LABEL "XCB integration" - CONDITION TARGET XCB::XCB AND TARGET XCB::XFIXES -) qt_feature("vkb-layouts" PUBLIC LABEL "Built-in layouts" ) diff --git a/src/virtualkeyboard/desktopinputpanel.cpp b/src/virtualkeyboard/desktopinputpanel.cpp index cdaf1ffd..399c54ae 100644 --- a/src/virtualkeyboard/desktopinputpanel.cpp +++ b/src/virtualkeyboard/desktopinputpanel.cpp @@ -38,10 +38,6 @@ #include <QQmlEngine> #include <QScreen> #include <QtVirtualKeyboard/private/virtualkeyboarddebug_p.h> -#if QT_CONFIG(vkb_xcb) -#include <xcb/xcb.h> -#include <xcb/xfixes.h> -#endif #include <qpa/qplatformnativeinterface.h> #include <QtCore/private/qobject_p.h> #include <QtCore/QLibraryInfo> @@ -226,18 +222,6 @@ void DesktopInputPanel::previewVisibleChanged() updateInputRegion(); } -#if QT_CONFIG(vkb_xcb) -static inline xcb_rectangle_t qRectToXCBRectangle(const QRect &r) -{ - xcb_rectangle_t result; - result.x = qMax(SHRT_MIN, r.x()); - result.y = qMax(SHRT_MIN, r.y()); - result.width = qMin((int)USHRT_MAX, r.width()); - result.height = qMin((int)USHRT_MAX, r.height()); - return result; -} -#endif - void DesktopInputPanel::updateInputRegion() { Q_D(DesktopInputPanel); @@ -249,36 +233,11 @@ void DesktopInputPanel::updateInputRegion() if (!d->view->handle()) d->view->create(); - switch (d->windowingSystem) { - case DesktopInputPanelPrivate::Xcb: -#if QT_CONFIG(vkb_xcb) - { - QList<xcb_rectangle_t> rects; - rects.push_back(qRectToXCBRectangle(d->keyboardRect.toRect())); - if (d->previewVisible && !d->previewRect.isEmpty()) - rects.push_back(qRectToXCBRectangle(d->previewRect.toRect())); - - QWindow *window = d->view.data(); - QPlatformNativeInterface *platformNativeInterface = QGuiApplication::platformNativeInterface(); - xcb_connection_t *xbcConnection = static_cast<xcb_connection_t *>(platformNativeInterface->nativeResourceForWindow("connection", window)); - xcb_xfixes_region_t xbcRegion = xcb_generate_id(xbcConnection); - xcb_xfixes_create_region(xbcConnection, xbcRegion, rects.size(), rects.constData()); - xcb_xfixes_set_window_shape_region(xbcConnection, window->winId(), XCB_SHAPE_SK_INPUT, 0, 0, xbcRegion); - xcb_xfixes_destroy_region(xbcConnection, xbcRegion); - } -#endif - break; + QRegion inputRegion(d->keyboardRect.toRect()); + if (d->previewVisible && !d->previewRect.isEmpty()) + inputRegion += d->previewRect.toRect(); - default: - { - QRegion inputRegion(d->keyboardRect.toRect()); - if (d->previewVisible && !d->previewRect.isEmpty()) - inputRegion += d->previewRect.toRect(); - - d->view->setMask(inputRegion); - break; - } - } + d->view->setMask(inputRegion); } } // namespace QtVirtualKeyboard |