diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-09-12 14:12:44 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2018-10-03 08:36:56 +0000 |
commit | a6160b7dbc47e707ef188f19fa52b5b2b572509a (patch) | |
tree | 0503595b838efe1a0f27d410382d82974d73e765 | |
parent | 9c5d1b634ea82fdc1b09713da4565b905d2c9123 (diff) | |
download | qtwayland-a6160b7dbc47e707ef188f19fa52b5b2b572509a.tar.gz |
Don't include system versions of wayland protocol
wayland-client.h and wayland-server.h includes protocol generated for the
version of wayland.xml corresponding to the libwayland version. This becomes a
problem when we want to support a version of wayland.xml that's newer than the
system libwayland.
The solution is to include wayland-client-core.h and wayland-client-server.h
instead. These headers don't include any wayland-scanner generated code, so we
can safely compile and link code generated against the version of wayland.xml
that we ship.
[ChangeLog] Code generated by qtwaylandscanner now includes
wayland-client-core.h and wayland-server-core.h instead of wayland-client.h and
wayland-server.h. This might break source compatibility for code using custom
wayland extensions.
Fixes: QTBUG-70553
Change-Id: Ice0cdb60ecc4f936acc0e158b96f7978549f62c1
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
52 files changed, 110 insertions, 67 deletions
diff --git a/features/wayland-scanner-client-wayland-protocol-include.prf b/features/wayland-scanner-client-wayland-protocol-include.prf new file mode 100644 index 00000000..9c5d2d1e --- /dev/null +++ b/features/wayland-scanner-client-wayland-protocol-include.prf @@ -0,0 +1,53 @@ +# Special version of WAYLANDCLIENTSOURCES to be used with protocols that +# have requests that create objects with interfaces defined in the core +# wayland protocol. +# +# E.g. the xcomposite protocol has a request which creates a wl_buffer. With +# the regular wayland-scanner.prf compilation would fail because +# wl_buffer_interface is not defined. +# +# This version solves the problem by prepending +# #include <QtWaylandClient/private/wayland-wayland-client-protocol.h> +# to the wayland-scanner generated files. + +isEmpty(QMAKE_WAYLAND_SCANNER):error("QMAKE_WAYLAND_SCANNER not defined for this mkspec") + +!isEmpty(MODULE_INCNAME) { + WAYLAND_INCLUDE_DIR = $$MODULE_INCNAME/private +} + +wayland_client_header.name = wayland ${QMAKE_FILE_BASE} +wayland_client_header.input = WAYLANDCLIENTSOURCES +wayland_client_header.variable_out = HEADERS +wayland_client_header.output = wayland-${QMAKE_FILE_BASE}-client-protocol$${first(QMAKE_EXT_H)} +# XXX: Prepend the necessary include in the generated header +wayland_client_header.commands = echo \"$${LITERAL_HASH}include <QtWaylandClient/private/wayland-wayland-client-protocol.h>\" > ${QMAKE_FILE_OUT} && $$QMAKE_WAYLAND_SCANNER --include-core-only client-header < ${QMAKE_FILE_IN} >> ${QMAKE_FILE_OUT} +QMAKE_EXTRA_COMPILERS += wayland_client_header + +wayland_code.name = wayland ${QMAKE_FILE_BASE} +wayland_code.input = WAYLANDCLIENTSOURCES +wayland_code.variable_out = SOURCES +wayland_code.output = wayland-${QMAKE_FILE_BASE}-protocol.c +wayland_code.commands = $$QMAKE_WAYLAND_SCANNER --include-core-only code < ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} +silent:wayland_code.commands = @echo Wayland code header ${QMAKE_FILE_IN} && $$wayland_code.commands +QMAKE_EXTRA_COMPILERS += wayland_code + +qtPrepareTool(QMAKE_QTWAYLANDSCANNER, qtwaylandscanner) + +qtwayland_client_header.name = qtwayland ${QMAKE_FILE_BASE} +qtwayland_client_header.input = WAYLANDCLIENTSOURCES +qtwayland_client_header.variable_out = HEADERS +qtwayland_client_header.depends += $$QMAKE_QTWAYLANDSCANNER_EXE wayland-${QMAKE_FILE_BASE}-client-protocol$${first(QMAKE_EXT_H)} +qtwayland_client_header.output = qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} +qtwayland_client_header.commands = $$QMAKE_QTWAYLANDSCANNER client-header ${QMAKE_FILE_IN} $$WAYLAND_INCLUDE_DIR > ${QMAKE_FILE_OUT} +silent:qtwayland_client_header.commands = @echo QtWayland client header ${QMAKE_FILE_IN} && $$qtwayland_client_header.commands +QMAKE_EXTRA_COMPILERS += qtwayland_client_header + +qtwayland_client_code.name = qtwayland ${QMAKE_FILE_BASE} +qtwayland_client_code.input = WAYLANDCLIENTSOURCES +qtwayland_client_code.variable_out = SOURCES +qtwayland_client_code.depends += $$QMAKE_QTWAYLANDSCANNER_EXE qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} +qtwayland_client_code.output = qwayland-${QMAKE_FILE_BASE}.cpp +qtwayland_client_code.commands = $$QMAKE_QTWAYLANDSCANNER client-code ${QMAKE_FILE_IN} $$WAYLAND_INCLUDE_DIR > ${QMAKE_FILE_OUT} +silent:qtwayland_client_code.commands = @echo QtWayland client code ${QMAKE_FILE_IN} && $$qtwayland_client_code.commands +QMAKE_EXTRA_COMPILERS += qtwayland_client_code diff --git a/src/client/client.pro b/src/client/client.pro index 45bbb976..d65866e6 100644 --- a/src/client/client.pro +++ b/src/client/client.pro @@ -29,9 +29,7 @@ WAYLANDCLIENTSOURCES += \ ../extensions/qt-windowmanager.xml \ ../3rdparty/protocol/text-input-unstable-v2.xml \ ../3rdparty/protocol/xdg-output-unstable-v1.xml \ - -WAYLANDCLIENTSOURCES_SYSTEM += \ - ../3rdparty/protocol/wayland.xml \ + ../3rdparty/protocol/wayland.xml SOURCES += qwaylandintegration.cpp \ qwaylandnativeinterface.cpp \ diff --git a/src/client/qwaylandabstractdecoration_p.h b/src/client/qwaylandabstractdecoration_p.h index d1b11928..f5b1854d 100644 --- a/src/client/qwaylandabstractdecoration_p.h +++ b/src/client/qwaylandabstractdecoration_p.h @@ -61,8 +61,6 @@ #include <QtGui/QImage> #include <QtWaylandClient/qtwaylandclientglobal.h> -#include <wayland-client.h> - #include <QtCore/QDebug> QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandbuffer_p.h b/src/client/qwaylandbuffer_p.h index eea090f3..945f1279 100644 --- a/src/client/qwaylandbuffer_p.h +++ b/src/client/qwaylandbuffer_p.h @@ -56,8 +56,7 @@ #include <QtCore/QSize> #include <QtCore/QRect> -#include <wayland-client.h> -#include <wayland-client-protocol.h> +#include <QtWaylandClient/private/wayland-wayland-client-protocol.h> QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index 0dd8d7af..d03ea294 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -59,8 +59,6 @@ #include <QtCore/QWaitCondition> #include <QtCore/QLoggingCategory> -#include <wayland-client.h> - #include <QtWaylandClient/private/qwayland-wayland.h> #include <QtWaylandClient/private/qtwaylandclientglobal_p.h> #include <QtWaylandClient/private/qwaylandshm_p.h> diff --git a/src/client/qwaylandextendedsurface_p.h b/src/client/qwaylandextendedsurface_p.h index cd604f34..d71ac6be 100644 --- a/src/client/qwaylandextendedsurface_p.h +++ b/src/client/qwaylandextendedsurface_p.h @@ -56,7 +56,6 @@ #include <QtWaylandClient/qtwaylandclientglobal.h> -#include <wayland-client.h> #include <QtWaylandClient/private/qwayland-surface-extension.h> QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandinputcontext_p.h b/src/client/qwaylandinputcontext_p.h index 93300e1f..10132dfe 100644 --- a/src/client/qwaylandinputcontext_p.h +++ b/src/client/qwaylandinputcontext_p.h @@ -62,6 +62,9 @@ #include <QtWaylandClient/private/qwayland-text-input-unstable-v2.h> #include <qwaylandinputmethodeventbuilder_p.h> +struct wl_callback; +struct wl_callback_listener; + QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(qLcQpaInputMethods) diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h index 4b12cc08..e1f0f507 100644 --- a/src/client/qwaylandinputdevice_p.h +++ b/src/client/qwaylandinputdevice_p.h @@ -61,8 +61,6 @@ #include <qpa/qplatformscreen.h> #include <qpa/qwindowsysteminterface.h> -#include <wayland-client.h> - #include <QtWaylandClient/private/qwayland-wayland.h> #if QT_CONFIG(xkbcommon_evdev) diff --git a/src/client/qwaylandshellsurface_p.h b/src/client/qwaylandshellsurface_p.h index f034e1bd..f683d9e0 100644 --- a/src/client/qwaylandshellsurface_p.h +++ b/src/client/qwaylandshellsurface_p.h @@ -54,8 +54,6 @@ #include <QtCore/QSize> #include <QObject> -#include <wayland-client.h> - #include <QtWaylandClient/private/qwayland-wayland.h> #include <QtWaylandClient/qtwaylandclientglobal.h> diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index ecb03c0d..8cc9598f 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -49,8 +49,7 @@ #include <QtGui/QPainter> #include <QMutexLocker> -#include <wayland-client.h> -#include <wayland-client-protocol.h> +#include <QtWaylandClient/private/wayland-wayland-client-protocol.h> #include <unistd.h> #include <sys/mman.h> diff --git a/src/client/qwaylandsubsurface_p.h b/src/client/qwaylandsubsurface_p.h index e9a7cb20..76da10b2 100644 --- a/src/client/qwaylandsubsurface_p.h +++ b/src/client/qwaylandsubsurface_p.h @@ -51,8 +51,6 @@ // We mean it. // -#include <wayland-client.h> - #include <QtCore/qglobal.h> #include <QtCore/qmutex.h> diff --git a/src/client/qwaylandwindowmanagerintegration_p.h b/src/client/qwaylandwindowmanagerintegration_p.h index 1319abd9..31de6ddd 100644 --- a/src/client/qwaylandwindowmanagerintegration_p.h +++ b/src/client/qwaylandwindowmanagerintegration_p.h @@ -54,7 +54,6 @@ #include <QtCore/QObject> #include <QtCore/QScopedPointer> -#include <wayland-client.h> #include <QtServiceSupport/private/qgenericunixservices_p.h> #include <QtWaylandClient/private/qwayland-qt-windowmanager.h> diff --git a/src/compositor/compositor_api/qwaylandclient.cpp b/src/compositor/compositor_api/qwaylandclient.cpp index 7f0b225b..d26dfc6d 100644 --- a/src/compositor/compositor_api/qwaylandclient.cpp +++ b/src/compositor/compositor_api/qwaylandclient.cpp @@ -44,7 +44,7 @@ #include <QtWaylandCompositor/private/qwaylandcompositor_p.h> -#include <wayland-server.h> +#include <wayland-server-core.h> #include <wayland-util.h> QT_BEGIN_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylanddestroylistener_p.h b/src/compositor/compositor_api/qwaylanddestroylistener_p.h index 7c6001c3..0bbeb69c 100644 --- a/src/compositor/compositor_api/qwaylanddestroylistener_p.h +++ b/src/compositor/compositor_api/qwaylanddestroylistener_p.h @@ -55,7 +55,7 @@ #include <QtCore/private/qobject_p.h> -#include <wayland-server.h> +#include <wayland-server-core.h> QT_BEGIN_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index e913a5a8..19c0656c 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -64,7 +64,7 @@ #include <QtCore/QMutexLocker> #include <QtCore/QMutex> -#include <wayland-server.h> +#include <wayland-server-core.h> #include <QThread> #ifndef GL_TEXTURE_EXTERNAL_OES diff --git a/src/compositor/extensions/pregenerated/3rdparty/wayland-xdg-shell-unstable-v5-server-protocol_p.h b/src/compositor/extensions/pregenerated/3rdparty/wayland-xdg-shell-unstable-v5-server-protocol_p.h index b979f048..493fd52d 100644 --- a/src/compositor/extensions/pregenerated/3rdparty/wayland-xdg-shell-unstable-v5-server-protocol_p.h +++ b/src/compositor/extensions/pregenerated/3rdparty/wayland-xdg-shell-unstable-v5-server-protocol_p.h @@ -6,7 +6,7 @@ #include <stdint.h> #include <stddef.h> -#include "wayland-server.h" +#include "wayland-server-core.h" #ifdef __cplusplus extern "C" { diff --git a/src/compositor/extensions/qwaylandwlshell_p.h b/src/compositor/extensions/qwaylandwlshell_p.h index e8d568fc..f8a29bac 100644 --- a/src/compositor/extensions/qwaylandwlshell_p.h +++ b/src/compositor/extensions/qwaylandwlshell_p.h @@ -46,7 +46,7 @@ #include <QtWaylandCompositor/QWaylandWlShellSurface> #include <QtWaylandCompositor/QWaylandSeat> -#include <wayland-server.h> +#include <wayland-server-core.h> #include <QHash> #include <QPoint> #include <QSet> diff --git a/src/compositor/global/qwaylandcompositorextension.cpp b/src/compositor/global/qwaylandcompositorextension.cpp index e50df48b..91298539 100644 --- a/src/compositor/global/qwaylandcompositorextension.cpp +++ b/src/compositor/global/qwaylandcompositorextension.cpp @@ -44,7 +44,7 @@ #include <QtCore/QCoreApplication> #include <QtCore/QDebug> -#include <wayland-server.h> +#include <wayland-server-core.h> QT_BEGIN_NAMESPACE diff --git a/src/compositor/hardware_integration/qwlclientbufferintegration_p.h b/src/compositor/hardware_integration/qwlclientbufferintegration_p.h index 13a69fce..7b458fbc 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegration_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegration_p.h @@ -55,7 +55,7 @@ #include <QtWaylandCompositor/qwaylandsurface.h> #include <QtWaylandCompositor/qwaylandbufferref.h> #include <QtCore/QSize> -#include <wayland-server.h> +#include <wayland-server-core.h> QT_BEGIN_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlclientbuffer.cpp b/src/compositor/wayland_wrapper/qwlclientbuffer.cpp index 7df9ead3..cb1ee3da 100644 --- a/src/compositor/wayland_wrapper/qwlclientbuffer.cpp +++ b/src/compositor/wayland_wrapper/qwlclientbuffer.cpp @@ -47,7 +47,7 @@ #include <QtCore/QDebug> -#include <wayland-server-protocol.h> +#include <QtWaylandCompositor/private/wayland-wayland-server-protocol.h> #include "qwaylandsharedmemoryformathelper_p.h" #include <QtWaylandCompositor/private/qwaylandcompositor_p.h> diff --git a/src/compositor/wayland_wrapper/qwlclientbuffer_p.h b/src/compositor/wayland_wrapper/qwlclientbuffer_p.h index ac8c1ed0..cd5c1e1d 100644 --- a/src/compositor/wayland_wrapper/qwlclientbuffer_p.h +++ b/src/compositor/wayland_wrapper/qwlclientbuffer_p.h @@ -59,7 +59,7 @@ #include <QtWaylandCompositor/QWaylandSurface> #include <QtWaylandCompositor/QWaylandBufferRef> -#include <wayland-server.h> +#include <wayland-server-core.h> QT_BEGIN_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri index e19ea253..3e29fb10 100644 --- a/src/compositor/wayland_wrapper/wayland_wrapper.pri +++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri @@ -1,6 +1,6 @@ CONFIG += wayland-scanner -WAYLANDSERVERSOURCES_SYSTEM += \ - ../3rdparty/protocol/wayland.xml \ +WAYLANDSERVERSOURCES += \ + ../3rdparty/protocol/wayland.xml HEADERS += \ wayland_wrapper/qwlbuffermanager_p.h \ diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h index 5e8a3bf4..9a614f58 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h @@ -41,7 +41,7 @@ #define QWAYLANDBRCMEGLINTEGRATION_H #include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h> -#include <wayland-client.h> +#include <wayland-client-core.h> #include <EGL/egl.h> #include <EGL/eglext.h> diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp index 5cd52f67..31adf100 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp @@ -50,7 +50,6 @@ #include <EGL/eglext_brcm.h> -#include <wayland-client.h> #include "wayland-brcm-client-protocol.h" QT_BEGIN_NAMESPACE diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp index 4b3a635c..e5f226d5 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp @@ -42,7 +42,7 @@ #include "qwaylandeglwindow.h" #include "qwaylandglcontext.h" -#include <wayland-client.h> +#include <wayland-client-core.h> #include <QtCore/QDebug> #include <private/qeglconvenience_p.h> diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglinclude.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglinclude.h index 233ce78b..e9998b83 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglinclude.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglinclude.h @@ -41,7 +41,7 @@ #define QWAYLANDEGLINCLUDE_H #include <string.h> -#include <wayland-client.h> +#include <wayland-client-core.h> #include <wayland-egl.h> diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp index aa5367e0..104a4df9 100644 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp +++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp @@ -118,7 +118,7 @@ const struct qt_xcomposite_listener QWaylandXCompositeEGLClientBufferIntegration QWaylandXCompositeEGLClientBufferIntegration::rootInformation }; -void QWaylandXCompositeEGLClientBufferIntegration::wlDisplayHandleGlobal(void *data, wl_registry *registry, uint32_t id, const QString &interface, uint32_t version) +void QWaylandXCompositeEGLClientBufferIntegration::wlDisplayHandleGlobal(void *data, ::wl_registry *registry, uint32_t id, const QString &interface, uint32_t version) { Q_UNUSED(version); if (interface == "qt_xcomposite") { diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h index ee55d689..7037ee2d 100644 --- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h +++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h @@ -41,7 +41,7 @@ #define QWAYLANDXCOMPOSITEEGLCLIENTBUFFERINTEGRATION_H #include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h> -#include <wayland-client.h> +#include <wayland-client-core.h> #include <QtCore/QTextStream> #include <QtCore/QDataStream> @@ -64,6 +64,7 @@ struct qt_xcomposite; struct qt_xcomposite_listener; +struct wl_registry; QT_BEGIN_NAMESPACE @@ -100,7 +101,7 @@ private: int mScreen; Window mRootWindow; - static void wlDisplayHandleGlobal(void *data, struct wl_registry *registry, uint32_t id, + static void wlDisplayHandleGlobal(void *data, struct ::wl_registry *registry, uint32_t id, const QString &interface, uint32_t version); static const struct ::qt_xcomposite_listener xcomposite_listener; diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp index 090cfb8a..8be47fa2 100644 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp +++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp @@ -109,7 +109,7 @@ const struct qt_xcomposite_listener QWaylandXCompositeGLXIntegration::xcomposite QWaylandXCompositeGLXIntegration::rootInformation }; -void QWaylandXCompositeGLXIntegration::wlDisplayHandleGlobal(void *data, wl_registry *registry, uint32_t id, const QString &interface, uint32_t version) +void QWaylandXCompositeGLXIntegration::wlDisplayHandleGlobal(void *data, ::wl_registry *registry, uint32_t id, const QString &interface, uint32_t version) { Q_UNUSED(version); if (interface == "qt_xcomposite") { diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h index 26f2bad6..80969081 100644 --- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h +++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h @@ -41,7 +41,7 @@ #define QWAYLANDXCOMPOSITEGLXINTEGRATION_H #include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h> -#include <wayland-client.h> +#include <wayland-client-core.h> #include <QtCore/QTextStream> #include <QtCore/QDataStream> @@ -59,6 +59,7 @@ struct qt_xcomposite; struct qt_xcomposite_listener; +struct wl_registry; QT_BEGIN_NAMESPACE @@ -93,7 +94,7 @@ private: int mScreen = 0; Window mRootWindow = 0; - static void wlDisplayHandleGlobal(void *data, struct wl_registry *registry, uint32_t id, + static void wlDisplayHandleGlobal(void *data, struct ::wl_registry *registry, uint32_t id, const QString &interface, uint32_t version); static const struct qt_xcomposite_listener xcomposite_listener; diff --git a/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp b/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp index 5f1818cd..33d9a603 100644 --- a/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp +++ b/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp @@ -39,7 +39,6 @@ #include "qwaylandxcompositebuffer.h" -#include <wayland-client.h> #include "wayland-xcomposite-client-protocol.h" QT_BEGIN_NAMESPACE diff --git a/src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri b/src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri index f255f5c5..a9120c26 100644 --- a/src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri +++ b/src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri @@ -1,7 +1,7 @@ INCLUDEPATH += $$PWD QMAKE_USE += xcomposite -CONFIG += wayland-scanner +CONFIG += wayland-scanner-client-wayland-protocol-include WAYLANDCLIENTSOURCES += $$PWD/../../../extensions/xcomposite.xml HEADERS += \ diff --git a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp index 5a42c00d..af905960 100644 --- a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp +++ b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp @@ -42,7 +42,7 @@ #include <QtGui/QOpenGLContext> #include <QtGui/QOpenGLTexture> #include <hybris/eglplatformcommon/hybris_nativebufferext.h> -#include <wayland-server.h> +#include <wayland-server-core.h> QT_BEGIN_NAMESPACE LibHybrisEglServerBuffer::LibHybrisEglServerBuffer(LibHybrisEglServerBufferIntegration *integration, const QImage &qimage, QtWayland::ServerBuffer::Format format) diff --git a/src/hardwareintegration/compositor/xcomposite_share/xcompositehandler.h b/src/hardwareintegration/compositor/xcomposite_share/xcompositehandler.h index bb43ed1a..28168994 100644 --- a/src/hardwareintegration/compositor/xcomposite_share/xcompositehandler.h +++ b/src/hardwareintegration/compositor/xcomposite_share/xcompositehandler.h @@ -45,7 +45,7 @@ #include "xlibinclude.h" #include "qwayland-server-xcomposite.h" -#include <wayland-server.h> +#include <wayland-server-core.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration_p.h b/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration_p.h index 80a7507d..3d76cc31 100644 --- a/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration_p.h +++ b/src/plugins/shellintegration/wl-shell/qwaylandwlshellintegration_p.h @@ -51,7 +51,6 @@ // We mean it. // -#include <wayland-client.h> #include <private/qwayland-wayland.h> #include <QtWaylandClient/private/qwaylandshellintegration_p.h> diff --git a/src/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h b/src/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h index 86305e4e..324c10aa 100644 --- a/src/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h +++ b/src/plugins/shellintegration/wl-shell/qwaylandwlshellsurface_p.h @@ -53,8 +53,6 @@ #include <QtCore/QSize> -#include <wayland-client.h> - #include <QtWaylandClient/qtwaylandclientglobal.h> #include <QtWaylandClient/private/qwayland-wayland.h> #include <QtWaylandClient/private/qwaylandshellsurface_p.h> diff --git a/src/plugins/shellintegration/xdg-shell-v5/pregenerated/3rdparty/qwayland-xdg-shell-unstable-v5.cpp b/src/plugins/shellintegration/xdg-shell-v5/pregenerated/3rdparty/qwayland-xdg-shell-unstable-v5.cpp index 0115eb1d..51979acf 100644 --- a/src/plugins/shellintegration/xdg-shell-v5/pregenerated/3rdparty/qwayland-xdg-shell-unstable-v5.cpp +++ b/src/plugins/shellintegration/xdg-shell-v5/pregenerated/3rdparty/qwayland-xdg-shell-unstable-v5.cpp @@ -25,6 +25,7 @@ * DEALINGS IN THE SOFTWARE. */ #include "qwayland-xdg-shell-unstable-v5_p.h" +#include <QtWaylandClient/private/wayland-wayland-client-protocol.h> QT_BEGIN_NAMESPACE QT_WARNING_PUSH diff --git a/src/plugins/shellintegration/xdg-shell-v5/pregenerated/3rdparty/qwayland-xdg-shell-unstable-v5_p.h b/src/plugins/shellintegration/xdg-shell-v5/pregenerated/3rdparty/qwayland-xdg-shell-unstable-v5_p.h index 3d8a6c13..8fb1ea7b 100644 --- a/src/plugins/shellintegration/xdg-shell-v5/pregenerated/3rdparty/qwayland-xdg-shell-unstable-v5_p.h +++ b/src/plugins/shellintegration/xdg-shell-v5/pregenerated/3rdparty/qwayland-xdg-shell-unstable-v5_p.h @@ -31,6 +31,8 @@ #include <QByteArray> #include <QString> +struct wl_registry; + QT_BEGIN_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") diff --git a/src/plugins/shellintegration/xdg-shell-v5/pregenerated/3rdparty/wayland-xdg-shell-unstable-v5-client-protocol_p.h b/src/plugins/shellintegration/xdg-shell-v5/pregenerated/3rdparty/wayland-xdg-shell-unstable-v5-client-protocol_p.h index 46644610..8877e883 100644 --- a/src/plugins/shellintegration/xdg-shell-v5/pregenerated/3rdparty/wayland-xdg-shell-unstable-v5-client-protocol_p.h +++ b/src/plugins/shellintegration/xdg-shell-v5/pregenerated/3rdparty/wayland-xdg-shell-unstable-v5-client-protocol_p.h @@ -7,7 +7,7 @@ #include <stdint.h> #include <stddef.h> -#include "wayland-client.h" +#include "wayland-client-core.h" #ifdef __cplusplus extern "C" { diff --git a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5_p.h b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5_p.h index ff8e5639..7494f6a6 100644 --- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5_p.h +++ b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgpopupv5_p.h @@ -53,8 +53,6 @@ #include "qwayland-xdg-shell-unstable-v5_p.h" -#include <wayland-client.h> - #include <QtWaylandClient/qtwaylandclientglobal.h> #include <QtWaylandClient/private/qwaylandshellsurface_p.h> diff --git a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5_p.h b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5_p.h index 67e5d32a..2b0a59f1 100644 --- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5_p.h +++ b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgshellv5_p.h @@ -56,8 +56,6 @@ #include <QtCore/QSize> #include <QtCore/QVector> -#include <wayland-client.h> - #include <QtWaylandClient/qtwaylandclientglobal.h> #include <QtWaylandClient/private/qwaylandshellsurface_p.h> diff --git a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5_p.h b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5_p.h index 741366fb..231a56d8 100644 --- a/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5_p.h +++ b/src/plugins/shellintegration/xdg-shell-v5/qwaylandxdgsurfacev5_p.h @@ -59,8 +59,6 @@ #include <QtCore/QSize> #include <QtCore/QMargins> -#include <wayland-client.h> - QT_BEGIN_NAMESPACE class QWindow; diff --git a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h index c6e89812..c88d111d 100644 --- a/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h +++ b/src/plugins/shellintegration/xdg-shell-v6/qwaylandxdgshellv6_p.h @@ -60,8 +60,6 @@ #include <QtCore/QSize> #include <QtGui/QRegion> -#include <wayland-client.h> - QT_BEGIN_NAMESPACE class QWindow; diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h index 591df9dd..77d6ec82 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h @@ -62,8 +62,6 @@ #include <QtCore/QSize> #include <QtGui/QRegion> -#include <wayland-client.h> - QT_BEGIN_NAMESPACE class QWindow; diff --git a/src/qtwaylandscanner/qtwaylandscanner.cpp b/src/qtwaylandscanner/qtwaylandscanner.cpp index f2e2d24d..4494b7c6 100644 --- a/src/qtwaylandscanner/qtwaylandscanner.cpp +++ b/src/qtwaylandscanner/qtwaylandscanner.cpp @@ -440,7 +440,7 @@ bool Scanner::process() printf("#ifndef %s\n", inclusionGuard.constData()); printf("#define %s\n", inclusionGuard.constData()); printf("\n"); - printf("#include \"wayland-server.h\"\n"); + printf("#include \"wayland-server-core.h\"\n"); if (m_headerPath.isEmpty()) printf("#include \"wayland-%s-server-protocol.h\"\n", QByteArray(m_protocolName).replace('_', '-').constData()); else @@ -938,6 +938,8 @@ bool Scanner::process() printf("#include <QByteArray>\n"); printf("#include <QString>\n"); printf("\n"); + printf("struct wl_registry;\n"); + printf("\n"); printf("QT_BEGIN_NAMESPACE\n"); printf("QT_WARNING_PUSH\n"); printf("QT_WARNING_DISABLE_GCC(\"-Wmissing-field-initializers\")\n"); @@ -1055,6 +1057,17 @@ bool Scanner::process() printf("QT_WARNING_DISABLE_GCC(\"-Wmissing-field-initializers\")\n"); printf("\n"); printf("namespace QtWayland {\n"); + printf("\n"); + + // wl_registry_bind is part of the protocol, so we can't use that... instead we use core + // libwayland API to do the same thing a wayland-scanner generated wl_registry_bind would. + printf("static inline void *wlRegistryBind(struct ::wl_registry *registry, uint32_t name, const struct ::wl_interface *interface, uint32_t version)\n"); + printf("{\n"); + printf(" const uint32_t bindOpCode = 0;\n"); + printf(" return (void *) wl_proxy_marshal_constructor_versioned((struct wl_proxy *) registry,\n"); + printf(" bindOpCode, interface, version, name, interface->name, version, NULL);\n"); + printf("}\n"); + printf("\n"); for (int j = 0; j < interfaces.size(); ++j) { const WaylandInterface &interface = interfaces.at(j); @@ -1095,7 +1108,7 @@ bool Scanner::process() printf(" void %s::init(struct ::wl_registry *registry, int id, int version)\n", interfaceName); printf(" {\n"); - printf(" m_%s = static_cast<struct ::%s *>(wl_registry_bind(registry, id, &%s_interface, version));\n", interfaceName, interfaceName, interfaceName); + printf(" m_%s = static_cast<struct ::%s *>(wlRegistryBind(registry, id, &%s_interface, version));\n", interfaceName, interfaceName, interfaceName); if (hasEvents) printf(" init_listener();\n"); printf(" }\n"); diff --git a/tests/auto/client/shared/mockcompositor.h b/tests/auto/client/shared/mockcompositor.h index 51b6f4bf..b0d6b088 100644 --- a/tests/auto/client/shared/mockcompositor.h +++ b/tests/auto/client/shared/mockcompositor.h @@ -34,7 +34,7 @@ #include <pthread.h> #include <qglobal.h> -#include <wayland-server.h> +#include <wayland-server-core.h> #include <QImage> #include <QMutex> @@ -121,7 +121,6 @@ private: wl_display *m_display = nullptr; wl_event_loop *m_loop = nullptr; - wl_shm *m_shm = nullptr; int m_fd = -1; uint32_t m_time = 0; diff --git a/tests/auto/compositor/compositor/compositor.pro b/tests/auto/compositor/compositor/compositor.pro index d69db4ca..29443f7a 100644 --- a/tests/auto/compositor/compositor/compositor.pro +++ b/tests/auto/compositor/compositor/compositor.pro @@ -13,6 +13,7 @@ qtConfig(xkbcommon-evdev): \ WAYLANDCLIENTSOURCES += \ ../../../../src/3rdparty/protocol/xdg-shell-unstable-v5.xml \ ../../../../src/3rdparty/protocol/ivi-application.xml \ + ../../../../src/3rdparty/protocol/wayland.xml SOURCES += \ tst_compositor.cpp \ diff --git a/tests/auto/compositor/compositor/mockclient.h b/tests/auto/compositor/compositor/mockclient.h index 6bfb652e..1d9f3277 100644 --- a/tests/auto/compositor/compositor/mockclient.h +++ b/tests/auto/compositor/compositor/mockclient.h @@ -26,7 +26,7 @@ ** ****************************************************************************/ -#include <wayland-client.h> +#include "wayland-wayland-client-protocol.h" #include <qwayland-xdg-shell-unstable-v5.h> #include <wayland-ivi-application-client-protocol.h> diff --git a/tests/auto/compositor/compositor/mockkeyboard.h b/tests/auto/compositor/compositor/mockkeyboard.h index 1090db59..fd7f06ae 100644 --- a/tests/auto/compositor/compositor/mockkeyboard.h +++ b/tests/auto/compositor/compositor/mockkeyboard.h @@ -30,7 +30,7 @@ #define MOCKKEYBOARD_H #include <QObject> -#include <wayland-client.h> +#include "wayland-wayland-client-protocol.h" class MockKeyboard : public QObject { diff --git a/tests/auto/compositor/compositor/mockpointer.h b/tests/auto/compositor/compositor/mockpointer.h index 2054040f..db6b2b69 100644 --- a/tests/auto/compositor/compositor/mockpointer.h +++ b/tests/auto/compositor/compositor/mockpointer.h @@ -30,7 +30,7 @@ #define MOCKPOINTER_H #include <QObject> -#include <wayland-client.h> +#include "wayland-wayland-client-protocol.h" class MockPointer : public QObject { diff --git a/tests/auto/compositor/compositor/mockseat.h b/tests/auto/compositor/compositor/mockseat.h index f8c103ed..0d0f4074 100644 --- a/tests/auto/compositor/compositor/mockseat.h +++ b/tests/auto/compositor/compositor/mockseat.h @@ -32,7 +32,7 @@ #include "mockkeyboard.h" #include <QObject> -#include <wayland-client.h> +#include "wayland-wayland-client-protocol.h" class MockSeat : public QObject { diff --git a/tests/auto/compositor/compositor/testcompositor.cpp b/tests/auto/compositor/compositor/testcompositor.cpp index 710bb7b3..22ecf28c 100644 --- a/tests/auto/compositor/compositor/testcompositor.cpp +++ b/tests/auto/compositor/compositor/testcompositor.cpp @@ -30,7 +30,7 @@ #include "testseat.h" #include "testkeyboardgrabber.h" -#include <wayland-server.h> +#include <wayland-server-core.h> TestCompositor::TestCompositor(bool createInputDev) : shell(new QWaylandWlShell(this)) |