diff options
-rw-r--r-- | .qmake.conf | 1 | ||||
-rw-r--r-- | src/client/qwaylandshmbackingstore.cpp | 14 | ||||
-rw-r--r-- | src/client/qwaylandshmbackingstore_p.h | 5 |
3 files changed, 11 insertions, 9 deletions
diff --git a/.qmake.conf b/.qmake.conf index 05ee6f974..2c01c5d2a 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,5 +2,6 @@ load(qt_build_config) DEFINES += QT_NO_FOREACH DEFINES += QT_NO_JAVA_STYLE_ITERATORS +DEFINES += QT_NO_LINKED_LIST MODULE_VERSION = 5.14.0 diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index d768e7fc2..9b5971a21 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -249,7 +249,7 @@ QWaylandShmBuffer *QWaylandShmBackingStore::getBuffer(const QSize &size) if (b->size() == size) { return b; } else { - mBuffers.removeOne(b); + mBuffers.remove(b); if (mBackBuffer == b) mBackBuffer = nullptr; delete b; @@ -257,11 +257,11 @@ QWaylandShmBuffer *QWaylandShmBackingStore::getBuffer(const QSize &size) } } - static const int MAX_BUFFERS = 5; - if (mBuffers.count() < MAX_BUFFERS) { + static const size_t MAX_BUFFERS = 5; + if (mBuffers.size() < MAX_BUFFERS) { QImage::Format format = QPlatformScreen::platformScreenForWindow(window())->format(); QWaylandShmBuffer *b = new QWaylandShmBuffer(mDisplay, size, format, waylandWindow()->scale()); - mBuffers.prepend(b); + mBuffers.push_front(b); return b; } return nullptr; @@ -300,9 +300,9 @@ void QWaylandShmBackingStore::resize(const QSize &size) // ensure the new buffer is at the beginning of the list so next time getBuffer() will pick // it if possible - if (mBuffers.first() != buffer) { - mBuffers.removeOne(buffer); - mBuffers.prepend(buffer); + if (mBuffers.front() != buffer) { + mBuffers.remove(buffer); + mBuffers.push_front(buffer); } if (windowDecoration() && window()->isVisible() && oldSizeInBytes != newSizeInBytes) diff --git a/src/client/qwaylandshmbackingstore_p.h b/src/client/qwaylandshmbackingstore_p.h index 88ecfc5ec..8a85cd7f3 100644 --- a/src/client/qwaylandshmbackingstore_p.h +++ b/src/client/qwaylandshmbackingstore_p.h @@ -57,7 +57,8 @@ #include <QtGui/QImage> #include <qpa/qplatformwindow.h> #include <QMutex> -#include <QLinkedList> + +#include <list> QT_BEGIN_NAMESPACE @@ -116,7 +117,7 @@ private: QWaylandShmBuffer *getBuffer(const QSize &size); QWaylandDisplay *mDisplay = nullptr; - QLinkedList<QWaylandShmBuffer *> mBuffers; + std::list<QWaylandShmBuffer *> mBuffers; QWaylandShmBuffer *mFrontBuffer = nullptr; QWaylandShmBuffer *mBackBuffer = nullptr; bool mPainting = false; |