From 56e4b5fa01eda59ee68daeced41f6adf73daa647 Mon Sep 17 00:00:00 2001 From: David Redondo Date: Mon, 13 May 2024 15:30:05 +0200 Subject: [PATCH] client: Remove support for surface extension Qt Wayland Compositor does not implement this anymore. Change-Id: If7a780218991aa35e9a34cd0eda3ae59a99844a2 Reviewed-by: David Edmundson --- .../wayland/extensions/surface-extension.xml | 62 ------------- src/plugins/platforms/wayland/CMakeLists.txt | 2 - .../wl-shell/qwaylandwlshellsurface.cpp | 35 ------- .../wl-shell/qwaylandwlshellsurface_p.h | 6 -- .../platforms/wayland/qwaylanddisplay.cpp | 5 - .../platforms/wayland/qwaylanddisplay_p.h | 6 -- .../wayland/qwaylandextendedsurface.cpp | 92 ------------------- .../wayland/qwaylandextendedsurface_p.h | 59 ------------ .../wayland/qwaylandnativeinterface.cpp | 1 - .../wayland/qwaylandshellsurface.cpp | 1 - 10 files changed, 269 deletions(-) delete mode 100644 src/3rdparty/wayland/extensions/surface-extension.xml delete mode 100644 src/plugins/platforms/wayland/qwaylandextendedsurface.cpp delete mode 100644 src/plugins/platforms/wayland/qwaylandextendedsurface_p.h diff --git a/src/3rdparty/wayland/extensions/surface-extension.xml b/src/3rdparty/wayland/extensions/surface-extension.xml deleted file mode 100644 index 231db0b35b2..00000000000 --- a/src/3rdparty/wayland/extensions/surface-extension.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - Copyright (C) 2015 The Qt Company Ltd. - SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/plugins/platforms/wayland/CMakeLists.txt b/src/plugins/platforms/wayland/CMakeLists.txt index 6bb8a891f40..4d0a106f658 100644 --- a/src/plugins/platforms/wayland/CMakeLists.txt +++ b/src/plugins/platforms/wayland/CMakeLists.txt @@ -30,7 +30,6 @@ qt_internal_add_module(WaylandClient qwaylanddecorationfactory.cpp qwaylanddecorationfactory_p.h qwaylanddecorationplugin.cpp qwaylanddecorationplugin_p.h qwaylanddisplay.cpp qwaylanddisplay_p.h - qwaylandextendedsurface.cpp qwaylandextendedsurface_p.h qwaylandfractionalscale.cpp qwaylandfractionalscale_p.h qwaylandinputcontext.cpp qwaylandinputcontext_p.h qwaylandtextinputv1.cpp qwaylandtextinputv1_p.h @@ -99,7 +98,6 @@ qt6_generate_wayland_protocol_client_sources(WaylandClient ${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/surface-extension.xml ${CMAKE_CURRENT_SOURCE_DIR}/../extensions/touch-extension.xml ${CMAKE_CURRENT_SOURCE_DIR}/hardwareintegration/../../extensions/hardware-integration.xml ${CMAKE_CURRENT_SOURCE_DIR}/hardwareintegration/../../extensions/server-buffer-extension.xml diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface.cpp b/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface.cpp index 4dc93cd988b..7ffa41c91ad 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface.cpp +++ b/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include @@ -21,9 +20,6 @@ QWaylandWlShellSurface::QWaylandWlShellSurface(struct ::wl_shell_surface *shell_ , QtWayland::wl_shell_surface(shell_surface) , m_window(window) { - if (window->display()->windowExtension()) - m_extendedWindow = new QWaylandExtendedSurface(window); - Qt::WindowType type = window->window()->type(); auto *transientParent = window->transientParent(); if (type == Qt::Popup && transientParent && transientParent->wlSurface()) @@ -37,7 +33,6 @@ QWaylandWlShellSurface::QWaylandWlShellSurface(struct ::wl_shell_surface *shell_ QWaylandWlShellSurface::~QWaylandWlShellSurface() { wl_shell_surface_destroy(object()); - delete m_extendedWindow; } bool QWaylandWlShellSurface::resize(QWaylandInputDevice *inputDevice, Qt::Edges edges) @@ -64,36 +59,6 @@ void QWaylandWlShellSurface::setAppId(const QString & appId) return QtWayland::wl_shell_surface::set_class(appId); } -void QWaylandWlShellSurface::raise() -{ - if (m_extendedWindow) - m_extendedWindow->raise(); -} - -void QWaylandWlShellSurface::lower() -{ - if (m_extendedWindow) - m_extendedWindow->lower(); -} - -void QWaylandWlShellSurface::setContentOrientationMask(Qt::ScreenOrientations orientation) -{ - if (m_extendedWindow) - m_extendedWindow->setContentOrientationMask(orientation); -} - -void QWaylandWlShellSurface::setWindowFlags(Qt::WindowFlags flags) -{ - if (m_extendedWindow) - m_extendedWindow->setWindowFlags(flags); -} - -void QWaylandWlShellSurface::sendProperty(const QString &name, const QVariant &value) -{ - if (m_extendedWindow) - m_extendedWindow->updateGenericProperty(name, value); -} - void QWaylandWlShellSurface::applyConfigure() { if ((m_pending.states & (Qt::WindowMaximized|Qt::WindowFullScreen)) diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h b/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h index 24600302895..780f5f3268e 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h +++ b/src/plugins/platforms/wayland/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h @@ -48,12 +48,6 @@ public: void setTitle(const QString & title) override; void setAppId(const QString &appId) override; - void raise() override; - void lower() override; - void setContentOrientationMask(Qt::ScreenOrientations orientation) override; - void setWindowFlags(Qt::WindowFlags flags) override; - void sendProperty(const QString &name, const QVariant &value) override; - void applyConfigure() override; bool wantsDecorations() const override; diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index e6ed0772fa4..f78bf2dd2a0 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -34,7 +34,6 @@ #include "qwaylandshellintegration_p.h" #include "qwaylandclientbufferintegration_p.h" -#include "qwaylandextendedsurface_p.h" #include "qwaylandpointergestures_p.h" #include "qwaylandsubsurface_p.h" #include "qwaylandtouch_p.h" @@ -642,10 +641,6 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin } else if (interface == QLatin1String(QWaylandDataDeviceManager::interface()->name)) { mGlobals.dndSelectionHandler.reset(new QWaylandDataDeviceManager(this, version, id)); #endif - } else if (interface == QLatin1String(QtWayland::qt_surface_extension::interface()->name)) { - mGlobals.surfaceExtension.reset( - new WithDestructor( - registry, id, 1)); } else if (interface == QLatin1String(QtWayland::wl_subcompositor::interface()->name)) { mGlobals.subCompositor.reset( new WithDestructor(registry, diff --git a/src/plugins/platforms/wayland/qwaylanddisplay_p.h b/src/plugins/platforms/wayland/qwaylanddisplay_p.h index 2fd176d8405..b93a2ecc0d2 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay_p.h +++ b/src/plugins/platforms/wayland/qwaylanddisplay_p.h @@ -48,7 +48,6 @@ class QPlatformScreen; class QPlatformPlaceholderScreen; namespace QtWayland { - class qt_surface_extension; class zwp_text_input_manager_v1; class zwp_text_input_manager_v2; class zwp_text_input_manager_v3; @@ -153,10 +152,6 @@ public: return mGlobals.primarySelectionManager.get(); } #endif - QtWayland::qt_surface_extension *windowExtension() const - { - return mGlobals.surfaceExtension.get(); - } #if QT_CONFIG(tabletevent) QWaylandTabletManagerV2 *tabletManager() const { @@ -323,7 +318,6 @@ private: #if QT_CONFIG(wayland_datadevice) std::unique_ptr dndSelectionHandler; #endif - std::unique_ptr surfaceExtension; std::unique_ptr subCompositor; std::unique_ptr touchExtension; std::unique_ptr qtKeyExtension; diff --git a/src/plugins/platforms/wayland/qwaylandextendedsurface.cpp b/src/plugins/platforms/wayland/qwaylandextendedsurface.cpp deleted file mode 100644 index a61612ce873..00000000000 --- a/src/plugins/platforms/wayland/qwaylandextendedsurface.cpp +++ /dev/null @@ -1,92 +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 "qwaylandextendedsurface_p.h" - -#include "qwaylandwindow_p.h" - -#include "qwaylanddisplay_p.h" - -#include "qwaylandnativeinterface_p.h" - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -QWaylandExtendedSurface::QWaylandExtendedSurface(QWaylandWindow *window) - : QtWayland::qt_extended_surface(window->display()->windowExtension()->get_extended_surface(window->wlSurface())) - , m_window(window) -{ -} - -QWaylandExtendedSurface::~QWaylandExtendedSurface() -{ - qt_extended_surface_destroy(object()); -} - -void QWaylandExtendedSurface::updateGenericProperty(const QString &name, const QVariant &value) -{ - QByteArray byteValue; - QDataStream ds(&byteValue, QIODevice::WriteOnly); - ds << value; - - update_generic_property(name, byteValue); -} - -void QWaylandExtendedSurface::setContentOrientationMask(Qt::ScreenOrientations mask) -{ - int32_t wlmask = 0; - if (mask & Qt::PrimaryOrientation) - wlmask |= QT_EXTENDED_SURFACE_ORIENTATION_PRIMARYORIENTATION; - if (mask & Qt::PortraitOrientation) - wlmask |= QT_EXTENDED_SURFACE_ORIENTATION_PORTRAITORIENTATION; - if (mask & Qt::LandscapeOrientation) - wlmask |= QT_EXTENDED_SURFACE_ORIENTATION_LANDSCAPEORIENTATION; - if (mask & Qt::InvertedPortraitOrientation) - wlmask |= QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDPORTRAITORIENTATION; - if (mask & Qt::InvertedLandscapeOrientation) - wlmask |= QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDLANDSCAPEORIENTATION; - set_content_orientation_mask(wlmask); -} - -void QWaylandExtendedSurface::extended_surface_onscreen_visibility(int32_t visibility) -{ - m_window->window()->setVisibility(static_cast(visibility)); -} - -void QWaylandExtendedSurface::extended_surface_set_generic_property(const QString &name, wl_array *value) -{ - QByteArray data = QByteArray::fromRawData(static_cast(value->data), value->size); - - QVariant variantValue; - QDataStream ds(data); - ds >> variantValue; - - m_window->setProperty(name, variantValue); -} - -void QWaylandExtendedSurface::extended_surface_close() -{ - QWindowSystemInterface::handleCloseEvent(m_window->window()); -} - -Qt::WindowFlags QWaylandExtendedSurface::setWindowFlags(Qt::WindowFlags flags) -{ - uint wlFlags = 0; - - if (flags & Qt::WindowStaysOnTopHint) wlFlags |= QT_EXTENDED_SURFACE_WINDOWFLAG_STAYSONTOP; - if (flags & Qt::WindowOverridesSystemGestures) wlFlags |= QT_EXTENDED_SURFACE_WINDOWFLAG_OVERRIDESSYSTEMGESTURES; - if (flags & Qt::BypassWindowManagerHint) wlFlags |= QT_EXTENDED_SURFACE_WINDOWFLAG_BYPASSWINDOWMANAGER; - - set_window_flags(wlFlags); - - return flags & (Qt::WindowStaysOnTopHint | Qt::WindowOverridesSystemGestures | Qt::BypassWindowManagerHint); -} - -} - -QT_END_NAMESPACE diff --git a/src/plugins/platforms/wayland/qwaylandextendedsurface_p.h b/src/plugins/platforms/wayland/qwaylandextendedsurface_p.h deleted file mode 100644 index 0a7c6e5adc4..00000000000 --- a/src/plugins/platforms/wayland/qwaylandextendedsurface_p.h +++ /dev/null @@ -1,59 +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 QWAYLANDEXTENDEDSURFACE_H -#define QWAYLANDEXTENDEDSURFACE_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 -#include -#include // for QVariantMap - -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -namespace QtWaylandClient { - -class QWaylandDisplay; -class QWaylandWindow; - -class Q_WAYLANDCLIENT_EXPORT QWaylandExtendedSurface : public QtWayland::qt_extended_surface -{ -public: - QWaylandExtendedSurface(QWaylandWindow *window); - ~QWaylandExtendedSurface() override; - - void setContentOrientationMask(Qt::ScreenOrientations mask); - - void updateGenericProperty(const QString &name, const QVariant &value); - - Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags); - -private: - void extended_surface_onscreen_visibility(int32_t visibility) override; - void extended_surface_set_generic_property(const QString &name, wl_array *value) override; - void extended_surface_close() override; - - QWaylandWindow *m_window = nullptr; - QVariantMap m_properties; -}; - -} - -QT_END_NAMESPACE - -#endif // QWAYLANDEXTENDEDSURFACE_H diff --git a/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp b/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp index 601f833aacc..e1586d2446f 100644 --- a/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp +++ b/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp @@ -6,7 +6,6 @@ #include "qwaylandwindow_p.h" #include "qwaylandshellintegration_p.h" #include "qwaylandsubsurface_p.h" -#include "qwaylandextendedsurface_p.h" #include "qwaylandintegration_p.h" #include "qwaylanddisplay_p.h" #include "qwaylandwindowmanagerintegration_p.h" diff --git a/src/plugins/platforms/wayland/qwaylandshellsurface.cpp b/src/plugins/platforms/wayland/qwaylandshellsurface.cpp index 77d6b97a9d8..fde1e1d3fbd 100644 --- a/src/plugins/platforms/wayland/qwaylandshellsurface.cpp +++ b/src/plugins/platforms/wayland/qwaylandshellsurface.cpp @@ -3,7 +3,6 @@ #include "qwaylandshellsurface_p.h" #include "qwaylandwindow_p.h" -#include "qwaylandextendedsurface_p.h" #include "qwaylandinputdevice_p.h" QT_BEGIN_NAMESPACE