aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorInho Lee <inho.lee@qt.io>2022-06-13 14:33:00 +0200
committerInho Lee <inho.lee@qt.io>2022-06-14 12:59:44 +0200
commit35235def29eeab80b2d1a6b89b3bfc6560bf13ef (patch)
tree790c8217064711791603622fc443f7848595790d /src
parent29f614d24836880d8c974faadfbe81fbfdce5086 (diff)
Remove platform-dependent codes for XCB
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 Pick-to: 6.4 6.3 6.2 5.15 Change-Id: I3430b2c2ec9abe486f5660c3e61f26c6bfc34806 Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Diffstat (limited to 'src')
-rw-r--r--src/virtualkeyboard/CMakeLists.txt11
-rw-r--r--src/virtualkeyboard/configure.cmake11
-rw-r--r--src/virtualkeyboard/desktopinputpanel.cpp49
3 files changed, 4 insertions, 67 deletions
diff --git a/src/virtualkeyboard/CMakeLists.txt b/src/virtualkeyboard/CMakeLists.txt
index 80981703..20571ce1 100644
--- a/src/virtualkeyboard/CMakeLists.txt
+++ b/src/virtualkeyboard/CMakeLists.txt
@@ -4,12 +4,6 @@
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()
-
set(qml_files
HandwritingInputPanel.qml
InputPanel.qml
@@ -95,11 +89,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 fd230ef9..d578330f 100644
--- a/src/virtualkeyboard/desktopinputpanel.cpp
+++ b/src/virtualkeyboard/desktopinputpanel.cpp
@@ -12,10 +12,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>
@@ -200,18 +196,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);
@@ -223,36 +207,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