From d65783c9e1f40e176943b8706bf6bbed8320bcc8 Mon Sep 17 00:00:00 2001 From: Christophe Chapuis Date: Sat, 16 Mar 2019 11:41:42 +0000 Subject: compositor: fix QWaylandShell private objects inheritance If the public API has inheritance relationships, this should be reflected in the private classes too. Otherwise the d_func will cast to a wrong type, leading to crashes. Change-Id: Iad2dccad4b63326e6b108a44c708ab51f0784678 Reviewed-by: Johan Helsing Reviewed-by: Paul Olav Tvete --- src/compositor/extensions/qwaylandshell.h | 4 ++-- src/compositor/extensions/qwaylandwlshell_p.h | 3 ++- src/compositor/extensions/qwaylandxdgshell_p.h | 3 ++- src/compositor/extensions/qwaylandxdgshellv5_p.h | 3 ++- src/compositor/extensions/qwaylandxdgshellv6_p.h | 3 ++- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/compositor/extensions/qwaylandshell.h b/src/compositor/extensions/qwaylandshell.h index a86938214..9241b8662 100644 --- a/src/compositor/extensions/qwaylandshell.h +++ b/src/compositor/extensions/qwaylandshell.h @@ -96,11 +96,11 @@ public: } protected: - QWaylandShellTemplate(QWaylandCompositorExtensionPrivate &dd) + QWaylandShellTemplate(QWaylandShellPrivate &dd) : QWaylandShell(dd) { } - QWaylandShellTemplate(QWaylandObject *container, QWaylandCompositorExtensionPrivate &dd) + QWaylandShellTemplate(QWaylandObject *container, QWaylandShellPrivate &dd) : QWaylandShell(container,dd) { } }; diff --git a/src/compositor/extensions/qwaylandwlshell_p.h b/src/compositor/extensions/qwaylandwlshell_p.h index e8d568fce..b2beca169 100644 --- a/src/compositor/extensions/qwaylandwlshell_p.h +++ b/src/compositor/extensions/qwaylandwlshell_p.h @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -67,7 +68,7 @@ QT_BEGIN_NAMESPACE class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandWlShellPrivate - : public QWaylandCompositorExtensionPrivate + : public QWaylandShellPrivate , public QtWaylandServer::wl_shell { Q_DECLARE_PUBLIC(QWaylandWlShell) diff --git a/src/compositor/extensions/qwaylandxdgshell_p.h b/src/compositor/extensions/qwaylandxdgshell_p.h index 9d1140fbd..3223abf3a 100644 --- a/src/compositor/extensions/qwaylandxdgshell_p.h +++ b/src/compositor/extensions/qwaylandxdgshell_p.h @@ -38,6 +38,7 @@ #define QWAYLANDXDGSHELL_P_H #include +#include #include #include @@ -73,7 +74,7 @@ struct Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgPositionerData { }; class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgShellPrivate - : public QWaylandCompositorExtensionPrivate + : public QWaylandShellPrivate , public QtWaylandServer::xdg_wm_base { Q_DECLARE_PUBLIC(QWaylandXdgShell) diff --git a/src/compositor/extensions/qwaylandxdgshellv5_p.h b/src/compositor/extensions/qwaylandxdgshellv5_p.h index 681c4537b..8f5af746b 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5_p.h +++ b/src/compositor/extensions/qwaylandxdgshellv5_p.h @@ -41,6 +41,7 @@ #define QWAYLANDXDGSHELLV5_P_H #include +#include #include #include @@ -61,7 +62,7 @@ QT_BEGIN_NAMESPACE class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgShellV5Private - : public QWaylandCompositorExtensionPrivate + : public QWaylandShellPrivate , public QtWaylandServer::xdg_shell_v5 { Q_DECLARE_PUBLIC(QWaylandXdgShellV5) diff --git a/src/compositor/extensions/qwaylandxdgshellv6_p.h b/src/compositor/extensions/qwaylandxdgshellv6_p.h index adc25cb71..457bc2201 100644 --- a/src/compositor/extensions/qwaylandxdgshellv6_p.h +++ b/src/compositor/extensions/qwaylandxdgshellv6_p.h @@ -38,6 +38,7 @@ #define QWAYLANDXDGSHELLV6_P_H #include +#include #include #include @@ -71,7 +72,7 @@ struct Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgPositionerV6Data { }; class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgShellV6Private - : public QWaylandCompositorExtensionPrivate + : public QWaylandShellPrivate , public QtWaylandServer::zxdg_shell_v6 { Q_DECLARE_PUBLIC(QWaylandXdgShellV6) -- cgit v1.2.3