diff options
author | Giulio Camuffo <giulio.camuffo@jollamobile.com> | 2015-04-23 19:32:28 +0300 |
---|---|---|
committer | Giulio Camuffo <giulio.camuffo@jollamobile.com> | 2015-05-28 07:48:22 +0000 |
commit | 817c7e0c365e9b0e2b9d4f3ed06dd192a57bd6af (patch) | |
tree | 5b84cf28217b9ab11ebee07fb73a39e71f77b3aa /src | |
parent | f87e9e28aaa37888baa3c530d74c61f8c5826ef1 (diff) | |
download | qtwayland-817c7e0c365e9b0e2b9d4f3ed06dd192a57bd6af.tar.gz qtwayland-817c7e0c365e9b0e2b9d4f3ed06dd192a57bd6af.tar.bz2 qtwayland-817c7e0c365e9b0e2b9d4f3ed06dd192a57bd6af.zip |
Fix crash when the wl_shm global comes after a wl_output one
Task-number: QTBUG-44503
Change-Id: I6932df57bb4560b6dceb72a5cb7c536cd090e92a
Reviewed-by: Martin Gräßlin <mgraesslin@kde.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/client/qwaylanddisplay.cpp | 1 | ||||
-rw-r--r-- | src/client/qwaylandscreen.cpp | 7 | ||||
-rw-r--r-- | src/client/qwaylandscreen_p.h | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index e0155fc9..c3925f5c 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -239,6 +239,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin mScreens.append(screen); // We need to get the output events before creating surfaces forceRoundTrip(); + screen->init(); mWaylandIntegration->screenAdded(screen); } else if (interface == QStringLiteral("wl_compositor")) { mCompositorVersion = qMin((int)version, 3); diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp index acd125c6..8a01e366 100644 --- a/src/client/qwaylandscreen.cpp +++ b/src/client/qwaylandscreen.cpp @@ -60,7 +60,7 @@ QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uin , mFormat(QImage::Format_ARGB32_Premultiplied) , mOutputName(QStringLiteral("Screen%1").arg(id)) , m_orientation(Qt::PrimaryOrientation) - , mWaylandCursor(new QWaylandCursor(this)) + , mWaylandCursor(0) { // handle case of output extension global being sent after outputs createExtendedOutput(); @@ -71,6 +71,11 @@ QWaylandScreen::~QWaylandScreen() delete mWaylandCursor; } +void QWaylandScreen::init() +{ + mWaylandCursor = new QWaylandCursor(this); +} + QWaylandDisplay * QWaylandScreen::display() const { return mWaylandDisplay; diff --git a/src/client/qwaylandscreen_p.h b/src/client/qwaylandscreen_p.h index 35adee34..06389f7e 100644 --- a/src/client/qwaylandscreen_p.h +++ b/src/client/qwaylandscreen_p.h @@ -53,6 +53,7 @@ public: QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id); ~QWaylandScreen(); + void init(); QWaylandDisplay *display() const; QRect geometry() const; |