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
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);
......
......@@ -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;
......
......@@ -53,6 +53,7 @@ public:
QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uint32_t id);
~QWaylandScreen();
void init();
QWaylandDisplay *display() 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