Merge remote-tracking branch 'origin/5.15' into 5.15.0
Change-Id: I09245b4d620fdf75cbee512d6c95aab1b1d54f99
This commit is contained in:
commit
377871d8e5
@ -251,7 +251,7 @@ QSharedPointer<QWaylandBuffer> QWaylandCursor::cursorBitmapBuffer(QWaylandDispla
|
|||||||
const QImage &img = cursor->pixmap().toImage();
|
const QImage &img = cursor->pixmap().toImage();
|
||||||
QSharedPointer<QWaylandShmBuffer> buffer(new QWaylandShmBuffer(display, img.size(), img.format()));
|
QSharedPointer<QWaylandShmBuffer> buffer(new QWaylandShmBuffer(display, img.size(), img.format()));
|
||||||
memcpy(buffer->image()->bits(), img.bits(), size_t(img.sizeInBytes()));
|
memcpy(buffer->image()->bits(), img.bits(), size_t(img.sizeInBytes()));
|
||||||
return std::move(buffer);
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWaylandCursor::changeCursor(QCursor *cursor, QWindow *window)
|
void QWaylandCursor::changeCursor(QCursor *cursor, QWindow *window)
|
||||||
|
@ -170,24 +170,27 @@ int QWaylandMimeData::readData(int fd, QByteArray &data) const
|
|||||||
timeout.tv_sec = 1;
|
timeout.tv_sec = 1;
|
||||||
timeout.tv_usec = 0;
|
timeout.tv_usec = 0;
|
||||||
|
|
||||||
int ready = select(FD_SETSIZE, &readset, nullptr, nullptr, &timeout);
|
Q_FOREVER {
|
||||||
if (ready < 0) {
|
int ready = select(FD_SETSIZE, &readset, nullptr, nullptr, &timeout);
|
||||||
qWarning() << "QWaylandDataOffer: select() failed";
|
if (ready < 0) {
|
||||||
return -1;
|
qWarning() << "QWaylandDataOffer: select() failed";
|
||||||
} else if (ready == 0) {
|
return -1;
|
||||||
qWarning("QWaylandDataOffer: timeout reading from pipe");
|
} else if (ready == 0) {
|
||||||
return -1;
|
qWarning("QWaylandDataOffer: timeout reading from pipe");
|
||||||
} else {
|
return -1;
|
||||||
char buf[4096];
|
} else {
|
||||||
int n = QT_READ(fd, buf, sizeof buf);
|
char buf[4096];
|
||||||
|
int n = QT_READ(fd, buf, sizeof buf);
|
||||||
|
|
||||||
if (n > 0) {
|
if (n < 0) {
|
||||||
data.append(buf, n);
|
qWarning("QWaylandDataOffer: read() failed");
|
||||||
n = readData(fd, data);
|
return -1;
|
||||||
} else if (n < 0) {
|
} else if (n == 0) {
|
||||||
qWarning("QWaylandDataOffer: read() failed");
|
return 0;
|
||||||
|
} else if (n > 0) {
|
||||||
|
data.append(buf, n);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return n;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ void QWaylandIntegration::initialize()
|
|||||||
|
|
||||||
int fd = wl_display_get_fd(mDisplay->wl_display());
|
int fd = wl_display_get_fd(mDisplay->wl_display());
|
||||||
QSocketNotifier *sn = new QSocketNotifier(fd, QSocketNotifier::Read, mDisplay.data());
|
QSocketNotifier *sn = new QSocketNotifier(fd, QSocketNotifier::Read, mDisplay.data());
|
||||||
QObject::connect(sn, SIGNAL(activated(int)), mDisplay.data(), SLOT(flushRequests()));
|
QObject::connect(sn, SIGNAL(activated(QSocketDescriptor)), mDisplay.data(), SLOT(flushRequests()));
|
||||||
|
|
||||||
// Qt does not support running with no screens
|
// Qt does not support running with no screens
|
||||||
mDisplay->ensureScreen();
|
mDisplay->ensureScreen();
|
||||||
|
@ -149,7 +149,7 @@ public:
|
|||||||
: compositor(c)
|
: compositor(c)
|
||||||
{
|
{
|
||||||
QSocketNotifier *notifier = new QSocketNotifier(compositor->waylandFileDescriptor(), QSocketNotifier::Read, this);
|
QSocketNotifier *notifier = new QSocketNotifier(compositor->waylandFileDescriptor(), QSocketNotifier::Read, this);
|
||||||
connect(notifier, SIGNAL(activated(int)), this, SLOT(processWaylandEvents()));
|
connect(notifier, SIGNAL(activated(QSocketDescriptor)), this, SLOT(processWaylandEvents()));
|
||||||
// connect to the event dispatcher to make sure to flush out the outgoing message queue
|
// connect to the event dispatcher to make sure to flush out the outgoing message queue
|
||||||
connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::awake, this, &tst_WaylandClient::processWaylandEvents);
|
connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::awake, this, &tst_WaylandClient::processWaylandEvents);
|
||||||
connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::aboutToBlock, this, &tst_WaylandClient::processWaylandEvents);
|
connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::aboutToBlock, this, &tst_WaylandClient::processWaylandEvents);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user