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>
This commit is contained in:
parent
022f452ed9
commit
f0a58486ef
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user