Commit 817c7e0c authored by Giulio Camuffo's avatar Giulio Camuffo
Browse files

Fix crash when the wl_shm global comes after a wl_output one


Task-number: QTBUG-44503
Change-Id: I6932df57bb4560b6dceb72a5cb7c536cd090e92a
Reviewed-by: default avatarMartin Gräßlin <mgraesslin@kde.org>
Reviewed-by: default avatarLaszlo Agocs <laszlo.agocs@theqtcompany.com>
Showing with 8 additions and 1 deletion
...@@ -239,6 +239,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin ...@@ -239,6 +239,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
mScreens.append(screen); mScreens.append(screen);
// We need to get the output events before creating surfaces // We need to get the output events before creating surfaces
forceRoundTrip(); forceRoundTrip();
screen->init();
mWaylandIntegration->screenAdded(screen); mWaylandIntegration->screenAdded(screen);
} else if (interface == QStringLiteral("wl_compositor")) { } else if (interface == QStringLiteral("wl_compositor")) {
mCompositorVersion = qMin((int)version, 3); mCompositorVersion = qMin((int)version, 3);
......
...@@ -60,7 +60,7 @@ QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uin ...@@ -60,7 +60,7 @@ QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uin
, mFormat(QImage::Format_ARGB32_Premultiplied) , mFormat(QImage::Format_ARGB32_Premultiplied)
, mOutputName(QStringLiteral("Screen%1").arg(id)) , mOutputName(QStringLiteral("Screen%1").arg(id))
, m_orientation(Qt::PrimaryOrientation) , m_orientation(Qt::PrimaryOrientation)
, mWaylandCursor(new QWaylandCursor(this)) , mWaylandCursor(0)
{ {
// handle case of output extension global being sent after outputs // handle case of output extension global being sent after outputs
createExtendedOutput(); createExtendedOutput();
...@@ -71,6 +71,11 @@ QWaylandScreen::~QWaylandScreen() ...@@ -71,6 +71,11 @@ QWaylandScreen::~QWaylandScreen()
delete mWaylandCursor; delete mWaylandCursor;
} }
void QWaylandScreen::init()
{
mWaylandCursor = new QWaylandCursor(this);
}
QWaylandDisplay * QWaylandScreen::display() const QWaylandDisplay * QWaylandScreen::display() const
{ {
return mWaylandDisplay; return mWaylandDisplay;
......
...@@ -53,6 +53,7 @@ public: ...@@ -53,6 +53,7 @@ public:
QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id); QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id);
~QWaylandScreen(); ~QWaylandScreen();
void init();
QWaylandDisplay *display() const; QWaylandDisplay *display() const;
QRect geometry() const; QRect geometry() const;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment