diff options
author | Olivier Blin <olivier.blin@softathome.com> | 2014-11-25 15:20:33 +0100 |
---|---|---|
committer | Olivier Blin <qt@blino.org> | 2015-03-27 15:17:27 +0000 |
commit | 7d59e55421321839605e1c08f23aeba4da1d8cd8 (patch) | |
tree | 43f8fc624111bb76141df4be6a21e1b088abe96d | |
parent | fc968d9ff868279350059bd37c7cbec8116a0156 (diff) | |
download | qtwayland-7d59e55421321839605e1c08f23aeba4da1d8cd8.tar.gz qtwayland-7d59e55421321839605e1c08f23aeba4da1d8cd8.tar.bz2 qtwayland-7d59e55421321839605e1c08f23aeba4da1d8cd8.zip |
Make QWaylandShellSurface a QObject to allow build without RTTI
dynamic_cast can not be used when RTTI is disabled, so make
QWaylandShellSurface a QObject.
QWaylandWlShellSurface and QWaylandXdgSurface must also inherit from
QWaylandShellSurface first, to properly inherit from QObject.
Change-Id: I2addb8105a0fe61615d4bc905414f7ee7277029f
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
-rw-r--r-- | src/client/qwaylandshellsurface_p.h | 4 | ||||
-rw-r--r-- | src/client/qwaylandwindow.cpp | 4 | ||||
-rw-r--r-- | src/client/qwaylandwlshellsurface_p.h | 5 | ||||
-rw-r--r-- | src/client/qwaylandxdgsurface_p.h | 5 |
4 files changed, 11 insertions, 7 deletions
diff --git a/src/client/qwaylandshellsurface_p.h b/src/client/qwaylandshellsurface_p.h index 6f233616..1f2346a9 100644 --- a/src/client/qwaylandshellsurface_p.h +++ b/src/client/qwaylandshellsurface_p.h @@ -43,6 +43,7 @@ #define QWAYLANDSHELLSURFACE_H #include <QtCore/QSize> +#include <QObject> #include <wayland-client.h> @@ -56,8 +57,9 @@ class QWaylandWindow; class QWaylandInputDevice; class QWindow; -class Q_WAYLAND_CLIENT_EXPORT QWaylandShellSurface +class Q_WAYLAND_CLIENT_EXPORT QWaylandShellSurface : public QObject { + Q_OBJECT public: explicit QWaylandShellSurface(QWaylandWindow *window); virtual ~QWaylandShellSurface() {} diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 976ebba1..1b939726 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -232,7 +232,7 @@ void QWaylandWindow::setVisible(bool visible) parent = mDisplay->lastInputWindow(); } if (parent) { - QWaylandWlShellSurface *wlshellSurface = dynamic_cast<QWaylandWlShellSurface*>(mShellSurface); + QWaylandWlShellSurface *wlshellSurface = qobject_cast<QWaylandWlShellSurface*>(mShellSurface); if (wlshellSurface) wlshellSurface->setPopup(parent, mDisplay->lastInputDevice(), mDisplay->lastInputSerial()); } @@ -481,7 +481,7 @@ bool QWaylandWindow::createDecoration() { // so far only xdg-shell support this "unminimize" trick, may be moved elsewhere if (mState == Qt::WindowMinimized) { - QWaylandXdgSurface *xdgSurface = dynamic_cast<QWaylandXdgSurface *>(mShellSurface); + QWaylandXdgSurface *xdgSurface = qobject_cast<QWaylandXdgSurface *>(mShellSurface); if ( xdgSurface ) { if (xdgSurface->isFullscreen()) { setWindowStateInternal(Qt::WindowFullScreen); diff --git a/src/client/qwaylandwlshellsurface_p.h b/src/client/qwaylandwlshellsurface_p.h index 8d6e298b..c9b8ac94 100644 --- a/src/client/qwaylandwlshellsurface_p.h +++ b/src/client/qwaylandwlshellsurface_p.h @@ -57,9 +57,10 @@ class QWaylandInputDevice; class QWindow; class QWaylandExtendedSurface; -class Q_WAYLAND_CLIENT_EXPORT QWaylandWlShellSurface : public QtWayland::wl_shell_surface - , public QWaylandShellSurface +class Q_WAYLAND_CLIENT_EXPORT QWaylandWlShellSurface : public QWaylandShellSurface + , public QtWayland::wl_shell_surface { + Q_OBJECT public: QWaylandWlShellSurface(struct ::wl_shell_surface *shell_surface, QWaylandWindow *window); virtual ~QWaylandWlShellSurface(); diff --git a/src/client/qwaylandxdgsurface_p.h b/src/client/qwaylandxdgsurface_p.h index 635c9496..f2871570 100644 --- a/src/client/qwaylandxdgsurface_p.h +++ b/src/client/qwaylandxdgsurface_p.h @@ -57,9 +57,10 @@ class QWaylandInputDevice; class QWindow; class QWaylandExtendedSurface; -class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgSurface : public QtWayland::xdg_surface - , public QWaylandShellSurface +class Q_WAYLAND_CLIENT_EXPORT QWaylandXdgSurface : public QWaylandShellSurface + , public QtWayland::xdg_surface { + Q_OBJECT public: QWaylandXdgSurface(struct ::xdg_surface *shell_surface, QWaylandWindow *window); virtual ~QWaylandXdgSurface(); |