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();
|
||||
QSharedPointer<QWaylandShmBuffer> buffer(new QWaylandShmBuffer(display, img.size(), img.format()));
|
||||
memcpy(buffer->image()->bits(), img.bits(), size_t(img.sizeInBytes()));
|
||||
return std::move(buffer);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
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_usec = 0;
|
||||
|
||||
int ready = select(FD_SETSIZE, &readset, nullptr, nullptr, &timeout);
|
||||
if (ready < 0) {
|
||||
qWarning() << "QWaylandDataOffer: select() failed";
|
||||
return -1;
|
||||
} else if (ready == 0) {
|
||||
qWarning("QWaylandDataOffer: timeout reading from pipe");
|
||||
return -1;
|
||||
} else {
|
||||
char buf[4096];
|
||||
int n = QT_READ(fd, buf, sizeof buf);
|
||||
Q_FOREVER {
|
||||
int ready = select(FD_SETSIZE, &readset, nullptr, nullptr, &timeout);
|
||||
if (ready < 0) {
|
||||
qWarning() << "QWaylandDataOffer: select() failed";
|
||||
return -1;
|
||||
} else if (ready == 0) {
|
||||
qWarning("QWaylandDataOffer: timeout reading from pipe");
|
||||
return -1;
|
||||
} else {
|
||||
char buf[4096];
|
||||
int n = QT_READ(fd, buf, sizeof buf);
|
||||
|
||||
if (n > 0) {
|
||||
data.append(buf, n);
|
||||
n = readData(fd, data);
|
||||
} else if (n < 0) {
|
||||
qWarning("QWaylandDataOffer: read() failed");
|
||||
if (n < 0) {
|
||||
qWarning("QWaylandDataOffer: read() failed");
|
||||
return -1;
|
||||
} else if (n == 0) {
|
||||
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());
|
||||
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
|
||||
mDisplay->ensureScreen();
|
||||
|
@ -149,7 +149,7 @@ public:
|
||||
: compositor(c)
|
||||
{
|
||||
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(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::awake, this, &tst_WaylandClient::processWaylandEvents);
|
||||
connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::aboutToBlock, this, &tst_WaylandClient::processWaylandEvents);
|
||||
|
Loading…
x
Reference in New Issue
Block a user