Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ia9584a185a3d7a68a4333890ade535585ba33fee
This commit is contained in:
commit
98c6cbdf79
@ -206,8 +206,10 @@ QWaylandXdgSurfaceV6::QWaylandXdgSurfaceV6(QWaylandXdgShellV6 *shell, ::zxdg_sur
|
|||||||
|
|
||||||
QWaylandXdgSurfaceV6::~QWaylandXdgSurfaceV6()
|
QWaylandXdgSurfaceV6::~QWaylandXdgSurfaceV6()
|
||||||
{
|
{
|
||||||
if (m_toplevel)
|
if (m_toplevel) {
|
||||||
zxdg_toplevel_v6_destroy(m_toplevel->object());
|
delete m_toplevel;
|
||||||
|
m_toplevel = nullptr;
|
||||||
|
}
|
||||||
if (m_popup) {
|
if (m_popup) {
|
||||||
delete m_popup;
|
delete m_popup;
|
||||||
m_popup = nullptr;
|
m_popup = nullptr;
|
||||||
|
@ -64,7 +64,9 @@ void QWaylandBuffer::init(wl_buffer *buf)
|
|||||||
|
|
||||||
void QWaylandBuffer::release(void *data, wl_buffer *)
|
void QWaylandBuffer::release(void *data, wl_buffer *)
|
||||||
{
|
{
|
||||||
static_cast<QWaylandBuffer *>(data)->mBusy = false;
|
QWaylandBuffer *self = static_cast<QWaylandBuffer *>(data);
|
||||||
|
self->mBusy = false;
|
||||||
|
self->mCommitted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const wl_buffer_listener QWaylandBuffer::listener = {
|
const wl_buffer_listener QWaylandBuffer::listener = {
|
||||||
|
@ -76,11 +76,15 @@ public:
|
|||||||
void setBusy() { mBusy = true; }
|
void setBusy() { mBusy = true; }
|
||||||
bool busy() const { return mBusy; }
|
bool busy() const { return mBusy; }
|
||||||
|
|
||||||
|
void setCommitted() { mCommitted = true; }
|
||||||
|
bool committed() const { return mCommitted; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
struct wl_buffer *mBuffer = nullptr;
|
struct wl_buffer *mBuffer = nullptr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool mBusy = false;
|
bool mBusy = false;
|
||||||
|
bool mCommitted = false;
|
||||||
|
|
||||||
static void release(void *data, wl_buffer *);
|
static void release(void *data, wl_buffer *);
|
||||||
static const wl_buffer_listener listener;
|
static const wl_buffer_listener listener;
|
||||||
|
@ -48,7 +48,6 @@
|
|||||||
#include <QtCore/qtemporaryfile.h>
|
#include <QtCore/qtemporaryfile.h>
|
||||||
#include <QtGui/QPainter>
|
#include <QtGui/QPainter>
|
||||||
#include <QMutexLocker>
|
#include <QMutexLocker>
|
||||||
#include <QLoggingCategory>
|
|
||||||
|
|
||||||
#include <wayland-client.h>
|
#include <wayland-client.h>
|
||||||
#include <wayland-client-protocol.h>
|
#include <wayland-client-protocol.h>
|
||||||
@ -68,10 +67,6 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
Q_DECLARE_LOGGING_CATEGORY(lcWaylandBackingstore)
|
|
||||||
|
|
||||||
Q_LOGGING_CATEGORY(lcWaylandBackingstore, "qt.qpa.wayland.backingstore")
|
|
||||||
|
|
||||||
QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display,
|
QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display,
|
||||||
const QSize &size, QImage::Format format, int scale)
|
const QSize &size, QImage::Format format, int scale)
|
||||||
{
|
{
|
||||||
@ -199,6 +194,8 @@ void QWaylandShmBackingStore::beginPaint(const QRegion ®ion)
|
|||||||
void QWaylandShmBackingStore::endPaint()
|
void QWaylandShmBackingStore::endPaint()
|
||||||
{
|
{
|
||||||
mPainting = false;
|
mPainting = false;
|
||||||
|
if (mPendingFlush)
|
||||||
|
flush(window(), mPendingRegion, QPoint());
|
||||||
waylandWindow()->setCanResize(true);
|
waylandWindow()->setCanResize(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,9 +215,19 @@ void QWaylandShmBackingStore::flush(QWindow *window, const QRegion ®ion, cons
|
|||||||
// called instead. The default implementation from QPlatformBackingStore is sufficient
|
// called instead. The default implementation from QPlatformBackingStore is sufficient
|
||||||
// however so no need to reimplement that.
|
// however so no need to reimplement that.
|
||||||
|
|
||||||
|
|
||||||
Q_UNUSED(window);
|
Q_UNUSED(window);
|
||||||
Q_UNUSED(offset);
|
Q_UNUSED(offset);
|
||||||
|
|
||||||
|
if (mPainting) {
|
||||||
|
mPendingRegion |= region;
|
||||||
|
mPendingFlush = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mPendingFlush = false;
|
||||||
|
mPendingRegion = QRegion();
|
||||||
|
|
||||||
if (windowDecoration() && windowDecoration()->isDirty())
|
if (windowDecoration() && windowDecoration()->isDirty())
|
||||||
updateDecorations();
|
updateDecorations();
|
||||||
|
|
||||||
|
@ -120,6 +120,8 @@ private:
|
|||||||
QWaylandShmBuffer *mFrontBuffer = nullptr;
|
QWaylandShmBuffer *mFrontBuffer = nullptr;
|
||||||
QWaylandShmBuffer *mBackBuffer = nullptr;
|
QWaylandShmBuffer *mBackBuffer = nullptr;
|
||||||
bool mPainting = false;
|
bool mPainting = false;
|
||||||
|
bool mPendingFlush = false;
|
||||||
|
QRegion mPendingRegion;
|
||||||
QMutex mMutex;
|
QMutex mMutex;
|
||||||
|
|
||||||
QSize mRequestedSize;
|
QSize mRequestedSize;
|
||||||
|
@ -73,6 +73,8 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
|
Q_LOGGING_CATEGORY(lcWaylandBackingstore, "qt.qpa.wayland.backingstore")
|
||||||
|
|
||||||
QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr;
|
QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr;
|
||||||
|
|
||||||
QWaylandWindow::QWaylandWindow(QWindow *window)
|
QWaylandWindow::QWaylandWindow(QWindow *window)
|
||||||
@ -534,6 +536,7 @@ void QWaylandWindow::handleScreenRemoved(QScreen *qScreen)
|
|||||||
|
|
||||||
void QWaylandWindow::attach(QWaylandBuffer *buffer, int x, int y)
|
void QWaylandWindow::attach(QWaylandBuffer *buffer, int x, int y)
|
||||||
{
|
{
|
||||||
|
Q_ASSERT(!buffer->committed());
|
||||||
if (mFrameCallback) {
|
if (mFrameCallback) {
|
||||||
wl_callback_destroy(mFrameCallback);
|
wl_callback_destroy(mFrameCallback);
|
||||||
mFrameCallback = nullptr;
|
mFrameCallback = nullptr;
|
||||||
@ -564,12 +567,18 @@ void QWaylandWindow::damage(const QRect &rect)
|
|||||||
|
|
||||||
void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage)
|
void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage)
|
||||||
{
|
{
|
||||||
|
if (buffer->committed()) {
|
||||||
|
qCDebug(lcWaylandBackingstore) << "Buffer already committed, ignoring.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!isInitialized())
|
if (!isInitialized())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
attachOffset(buffer);
|
attachOffset(buffer);
|
||||||
for (const QRect &rect: damage)
|
for (const QRect &rect: damage)
|
||||||
wl_surface::damage(rect.x(), rect.y(), rect.width(), rect.height());
|
wl_surface::damage(rect.x(), rect.y(), rect.width(), rect.height());
|
||||||
|
Q_ASSERT(!buffer->committed());
|
||||||
|
buffer->setCommitted();
|
||||||
wl_surface::commit();
|
wl_surface::commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@
|
|||||||
#include <QtCore/QMutex>
|
#include <QtCore/QMutex>
|
||||||
#include <QtGui/QIcon>
|
#include <QtGui/QIcon>
|
||||||
#include <QtCore/QVariant>
|
#include <QtCore/QVariant>
|
||||||
|
#include <QtCore/QLoggingCategory>
|
||||||
|
|
||||||
#include <qpa/qplatformwindow.h>
|
#include <qpa/qplatformwindow.h>
|
||||||
|
|
||||||
@ -67,6 +68,8 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
|
Q_DECLARE_LOGGING_CATEGORY(lcWaylandBackingstore)
|
||||||
|
|
||||||
class QWaylandDisplay;
|
class QWaylandDisplay;
|
||||||
class QWaylandBuffer;
|
class QWaylandBuffer;
|
||||||
class QWaylandShellSurface;
|
class QWaylandShellSurface;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user