diff options
author | Eskil Abrahamsen Blomfeldt <[email protected]> | 2025-02-07 14:13:36 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <[email protected]> | 2025-02-10 07:32:21 +0100 |
commit | 8de2aae8c173a52d02e5f4985cb0594a1661cd20 (patch) | |
tree | f79bc5c6e19d20d2d6c918c86a73e01f2a8e3f54 | |
parent | c57da9bb0a2d475b72024997657e250d171dcbaa (diff) |
Remove qt-key extension
This was an extension to make sure we send the full key
event the client was running against a Qt Wayland
Compositor.
But the world has moved on and this is now handled through
official extensions. And we have to support multiple
third-party compositors, so any issues that occur with
key event handling should be handled on a more "official"
level.
Task-number: QTBUG-133223
Change-Id: I96cf394fa0e79eeaeba6dfec0c0fc81f5320fdd4
Reviewed-by: Vlad Zahorodnii <[email protected]>
-rw-r--r-- | src/3rdparty/wayland/extensions/qt-key-unstable-v1.xml | 40 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/qwaylanddisplay.cpp | 3 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/qwaylanddisplay_p.h | 2 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandqtkey.cpp | 61 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandqtkey_p.h | 57 |
6 files changed, 0 insertions, 165 deletions
diff --git a/src/3rdparty/wayland/extensions/qt-key-unstable-v1.xml b/src/3rdparty/wayland/extensions/qt-key-unstable-v1.xml deleted file mode 100644 index 23b04648ba0..00000000000 --- a/src/3rdparty/wayland/extensions/qt-key-unstable-v1.xml +++ /dev/null @@ -1,40 +0,0 @@ -<protocol name="qt_key_unstable_v1"> - - <copyright> - Copyright (C) 2018 The Qt Company Ltd. - SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - </copyright> - - <interface name="zqt_key_v1" version="1"> - <description summary="send serialized QKeyEvents"> - This protocol is independent of the Wayland seat concept. Its - intention is to let a QKeyEvent be transferred from a Qt compositor - to a Qt client without losing or adding false information by going - through wl_seat and wl_keyboard. - - Note: This protocol is considered private to Qt. We will do our - best to bump version numbers when we make backwards compatible - changes, bump the protocol name and interface suffixes when we make - backwards incompatible changes, but we provide no guarantees. We - may also remove the protocol without warning. Implement this at - your own risk. - </description> - <event name="key"> - <description summary="send key event"> - The key event notifies the client that a QKeyEvent has occurred on - the server side. - </description> - <arg name="surface" type="object" interface="wl_surface"/> - <arg name="time" type="uint"/> - <arg name="type" type="uint"/> - <arg name="key" type="uint"/> - <arg name="modifiers" type="uint"/> - <arg name="nativeScanCode" type="uint"/> - <arg name="nativeVirtualKey" type="uint"/> - <arg name="nativeModifiers" type="uint"/> - <arg name="text" type="string"/> - <arg name="autorepeat" type="uint"/> - <arg name="count" type="uint"/> - </event> - </interface> -</protocol> diff --git a/src/plugins/platforms/wayland/CMakeLists.txt b/src/plugins/platforms/wayland/CMakeLists.txt index 4c62dc78ca2..0018f71307d 100644 --- a/src/plugins/platforms/wayland/CMakeLists.txt +++ b/src/plugins/platforms/wayland/CMakeLists.txt @@ -45,7 +45,6 @@ qt_internal_add_module(WaylandClient qwaylandnativeinterface.cpp qwaylandnativeinterface_p.h qwaylandplatformservices.cpp qwaylandplatformservices_p.h qwaylandpointergestures.cpp qwaylandpointergestures_p.h - qwaylandqtkey.cpp qwaylandqtkey_p.h qwaylandscreen.cpp qwaylandscreen_p.h qwaylandshellsurface.cpp qwaylandshellsurface_p.h qwaylandshm.cpp qwaylandshm_p.h @@ -116,7 +115,6 @@ qt6_generate_wayland_protocol_client_sources(WaylandClient ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/xdg-shell/xdg-shell.xml ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/xdg-system-bell/xdg-system-bell-v1.xml ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/protocol/xdg-toplevel-drag/xdg-toplevel-drag-v1.xml - ${CMAKE_CURRENT_SOURCE_DIR}/../extensions/qt-key-unstable-v1.xml ${CMAKE_CURRENT_SOURCE_DIR}/../extensions/qt-text-input-method-unstable-v1.xml ${CMAKE_CURRENT_SOURCE_DIR}/../extensions/qt-windowmanager.xml ${CMAKE_CURRENT_SOURCE_DIR}/../extensions/touch-extension.xml diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index ae773ed2b04..1ff7d25141d 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -43,7 +43,6 @@ #if QT_CONFIG(tabletevent) #include "qwaylandtabletv2_p.h" #endif -#include "qwaylandqtkey_p.h" #include "qwaylandcolormanagement_p.h" @@ -671,8 +670,6 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin id, 1)); } else if (interface == QLatin1String(QWaylandTouchExtension::interface()->name)) { mGlobals.touchExtension.reset(new QWaylandTouchExtension(this, id)); - } else if (interface == QLatin1String(QWaylandQtKeyExtension::interface()->name)) { - mGlobals.qtKeyExtension.reset(new QWaylandQtKeyExtension(this, id)); #if QT_CONFIG(tabletevent) } else if (interface == QLatin1String(QWaylandTabletManagerV2::interface()->name)) { mGlobals.tabletManager.reset(new QWaylandTabletManagerV2(this, id, qMin(1, int(version)))); diff --git a/src/plugins/platforms/wayland/qwaylanddisplay_p.h b/src/plugins/platforms/wayland/qwaylanddisplay_p.h index 2cad24dd6a2..15c564b291e 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay_p.h +++ b/src/plugins/platforms/wayland/qwaylanddisplay_p.h @@ -83,7 +83,6 @@ class QWaylandTabletManagerV2; #endif class QWaylandPointerGestures; class QWaylandTouchExtension; -class QWaylandQtKeyExtension; class QWaylandWindow; class QWaylandIntegration; class QWaylandHardwareIntegration; @@ -344,7 +343,6 @@ private: #endif std::unique_ptr<QtWayland::wl_subcompositor> subCompositor; std::unique_ptr<QWaylandTouchExtension> touchExtension; - std::unique_ptr<QWaylandQtKeyExtension> qtKeyExtension; #if QT_CONFIG(tabletevent) std::unique_ptr<QWaylandTabletManagerV2> tabletManager; #endif diff --git a/src/plugins/platforms/wayland/qwaylandqtkey.cpp b/src/plugins/platforms/wayland/qwaylandqtkey.cpp deleted file mode 100644 index 079a03e0ddb..00000000000 --- a/src/plugins/platforms/wayland/qwaylandqtkey.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only - -#include "qwaylandqtkey_p.h" -#include "qwaylandinputdevice_p.h" -#include "qwaylanddisplay_p.h" - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -QWaylandQtKeyExtension::QWaylandQtKeyExtension(QWaylandDisplay *display, uint32_t id) - : QtWayland::zqt_key_v1(display->wl_registry(), id, 1) - , m_display(display) -{ -} - -QWaylandQtKeyExtension::~QWaylandQtKeyExtension() -{ - zqt_key_v1_destroy(object()); -} - -void QWaylandQtKeyExtension::zqt_key_v1_key(struct wl_surface *surface, - uint32_t time, - uint32_t type, - uint32_t key, - uint32_t modifiers, - uint32_t nativeScanCode, - uint32_t nativeVirtualKey, - uint32_t nativeModifiers, - const QString &text, - uint32_t autorep, - uint32_t count) -{ - QList<QWaylandInputDevice *> inputDevices = m_display->inputDevices(); - if (!surface && inputDevices.isEmpty()) { - qWarning("qt_key_extension: handle_qtkey: No input device"); - return; - } - - QWaylandInputDevice *dev = inputDevices.first(); - - auto *win = surface ? QWaylandWindow::fromWlSurface(surface) : nullptr; - - if (!win) - win = dev->keyboardFocus(); - - if (!win || !win->window()) { - qWarning("qt_key_extension: handle_qtkey: No keyboard focus"); - return; - } - - QWindow *window = win->window(); - QWindowSystemInterface::handleExtendedKeyEvent(window, time, QEvent::Type(type), key, Qt::KeyboardModifiers(modifiers), - nativeScanCode, nativeVirtualKey, nativeModifiers, text, - autorep, count); -} - -} - -QT_END_NAMESPACE diff --git a/src/plugins/platforms/wayland/qwaylandqtkey_p.h b/src/plugins/platforms/wayland/qwaylandqtkey_p.h deleted file mode 100644 index 1544a01663d..00000000000 --- a/src/plugins/platforms/wayland/qwaylandqtkey_p.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only - -#ifndef QWAYLANDQTKEY_H -#define QWAYLANDQTKEY_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <qpa/qwindowsysteminterface.h> - -#include <QtWaylandClient/qtwaylandclientglobal.h> -#include <QtWaylandClient/private/qwayland-qt-key-unstable-v1.h> -#include <QtCore/private/qglobal_p.h> - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -class QWaylandDisplay; - -class Q_WAYLANDCLIENT_EXPORT QWaylandQtKeyExtension : public QtWayland::zqt_key_v1 -{ -public: - QWaylandQtKeyExtension(QWaylandDisplay *display, uint32_t id); - ~QWaylandQtKeyExtension(); - -private: - QWaylandDisplay *m_display = nullptr; - - void zqt_key_v1_key(struct wl_surface *surface, - uint32_t time, - uint32_t type, - uint32_t key, - uint32_t modifiers, - uint32_t nativeScanCode, - uint32_t nativeVirtualKey, - uint32_t nativeModifiers, - const QString &text, - uint32_t autorep, - uint32_t count) override; - -}; - -} - -QT_END_NAMESPACE - -#endif // QWAYLANDQTKEY_H |