Merge pull request #11463 from Rmys/master

qt5-declarative, qt5-wayland rebuild
This commit is contained in:
Rmys
2023-02-15 21:54:14 +03:00
committed by GitHub
4 changed files with 529 additions and 827 deletions
@@ -12,10 +12,10 @@ index b65b994d6c..15a8cd6878 100644
} }
} }
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 9899c9274e..272b85069f 100644 index e57cdd8278..94613598af 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -1160,8 +1160,7 @@ void Heap::QObjectWrapper::markObjects(Heap::Base *that, QV4::MarkStack *markSta @@ -1145,8 +1145,7 @@ void Heap::QObjectWrapper::markObjects(Heap::Base *that, QV4::MarkStack *markSta
void QObjectWrapper::destroyObject(bool lastCall) void QObjectWrapper::destroyObject(bool lastCall)
{ {
Heap::QObjectWrapper *h = d(); Heap::QObjectWrapper *h = d();
@@ -25,7 +25,7 @@ index 9899c9274e..272b85069f 100644
if (h->object()) { if (h->object()) {
QQmlData *ddata = QQmlData::get(h->object(), false); QQmlData *ddata = QQmlData::get(h->object(), false);
@@ -1191,7 +1190,7 @@ void QObjectWrapper::destroyObject(bool lastCall) @@ -1176,7 +1175,7 @@ void QObjectWrapper::destroyObject(bool lastCall)
} }
} }
@@ -47,6 +47,36 @@ index 06caf04e5a..da149a67c4 100644
it = multiplyWrappedQObjects->erase(it); it = multiplyWrappedQObjects->erase(it);
else else
++it; ++it;
diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp
index 175de8b936..a6ba4b8cb3 100644
--- a/src/qml/qml/qqmltypewrapper.cpp
+++ b/src/qml/qml/qqmltypewrapper.cpp
@@ -419,8 +419,10 @@ ReturnedValue QQmlTypeWrapper::virtualInstanceOf(const Object *typeObject, const
return Encode(false);
QQmlRefPointer<QQmlTypeData> td = qenginepriv->typeLoader.getType(typeWrapper->d()->type().sourceUrl());
- ExecutableCompilationUnit *cu = td->compilationUnit();
- myQmlType = qenginepriv->metaObjectForType(cu->metaTypeId);
+ if (ExecutableCompilationUnit *cu = td->compilationUnit())
+ myQmlType = qenginepriv->metaObjectForType(cu->metaTypeId);
+ else
+ return Encode(false); // It seems myQmlType has some errors, so we could not compile it.
} else {
myQmlType = qenginepriv->metaObjectForType(myTypeId);
}
diff --git a/src/qml/types/qqmlconnections.cpp b/src/qml/types/qqmlconnections.cpp
index 29ed62cd39..aba930dfe1 100644
--- a/src/qml/types/qqmlconnections.cpp
+++ b/src/qml/types/qqmlconnections.cpp
@@ -338,7 +338,7 @@ void QQmlConnections::connectSignalsToMethods()
&& propName.at(2).isUpper()) {
qmlWarning(this) << tr("Detected function \"%1\" in Connections element. "
"This is probably intended to be a signal handler but no "
- "signal of the target matches the name.").arg(propName);
+ "signal of the \"%2\" target matches the name.").arg(propName).arg(target->metaObject()->className());
}
}
}
diff --git a/src/qmlmodels/qqmldelegatemodel.cpp b/src/qmlmodels/qqmldelegatemodel.cpp diff --git a/src/qmlmodels/qqmldelegatemodel.cpp b/src/qmlmodels/qqmldelegatemodel.cpp
index 2079a8ed04..a577cb2351 100644 index 2079a8ed04..a577cb2351 100644
--- a/src/qmlmodels/qqmldelegatemodel.cpp --- a/src/qmlmodels/qqmldelegatemodel.cpp
@@ -250,214 +280,6 @@ index 8321fcfeed..383078b3b9 100644
drag->setMimeData(mimeData); drag->setMimeData(mimeData);
if (pixmapLoader.isReady()) { if (pixmapLoader.isReady()) {
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index e12e85db64..2fa3b7142c 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -62,6 +62,8 @@
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcHandlerParent)
+Q_LOGGING_CATEGORY(lcWheel, "qt.quick.flickable.wheel")
+Q_LOGGING_CATEGORY(lcVel, "qt.quick.flickable.velocity")
// FlickThreshold determines how far the "mouse" must have moved
// before we perform a flick.
@@ -263,7 +265,8 @@ QQuickFlickablePrivate::QQuickFlickablePrivate()
, deceleration(QML_FLICK_DEFAULTDECELERATION)
, maxVelocity(QML_FLICK_DEFAULTMAXVELOCITY), reportedVelocitySmoothing(100)
, delayedPressEvent(nullptr), pressDelay(0), fixupDuration(400)
- , flickBoost(1.0), fixupMode(Normal), vTime(0), visibleArea(nullptr)
+ , flickBoost(1.0), initialWheelFlickDistance(qApp->styleHints()->wheelScrollLines() * 24)
+ , fixupMode(Normal), vTime(0), visibleArea(nullptr)
, flickableDirection(QQuickFlickable::AutoFlickDirection)
, boundsBehavior(QQuickFlickable::DragAndOvershootBounds)
, boundsMovement(QQuickFlickable::FollowBoundsBehavior)
@@ -531,10 +534,14 @@ void QQuickFlickablePrivate::updateBeginningEnd()
if (atBeginning != vData.atBeginning) {
vData.atBeginning = atBeginning;
atYBeginningChange = true;
+ if (!vData.moving && atBeginning)
+ vData.smoothVelocity.setValue(0);
}
if (atEnd != vData.atEnd) {
vData.atEnd = atEnd;
atYEndChange = true;
+ if (!vData.moving && atEnd)
+ vData.smoothVelocity.setValue(0);
}
// Horizontal
@@ -547,10 +554,14 @@ void QQuickFlickablePrivate::updateBeginningEnd()
if (atBeginning != hData.atBeginning) {
hData.atBeginning = atBeginning;
atXBeginningChange = true;
+ if (!hData.moving && atBeginning)
+ hData.smoothVelocity.setValue(0);
}
if (atEnd != hData.atEnd) {
hData.atEnd = atEnd;
atXEndChange = true;
+ if (!hData.moving && atEnd)
+ hData.smoothVelocity.setValue(0);
}
if (vData.extentsChanged) {
@@ -1489,6 +1500,7 @@ void QQuickFlickable::wheelEvent(QWheelEvent *event)
d->hData.velocity = 0;
d->timer.start();
d->maybeBeginDrag(currentTimestamp, event->position());
+ d->lastPosTime = -1;
break;
case Qt::NoScrollPhase: // default phase with an ordinary wheel mouse
case Qt::ScrollUpdate:
@@ -1515,20 +1527,34 @@ void QQuickFlickable::wheelEvent(QWheelEvent *event)
return;
}
+ qreal elapsed = qreal(currentTimestamp - d->lastPosTime) / qreal(1000);
+ if (elapsed <= 0) {
+ d->lastPosTime = currentTimestamp;
+ qCDebug(lcWheel) << "insufficient elapsed time: can't calculate velocity" << elapsed;
+ return;
+ }
+
if (event->source() == Qt::MouseEventNotSynthesized || event->pixelDelta().isNull()) {
- // physical mouse wheel, so use angleDelta
+ // no pixel delta (physical mouse wheel, or "dumb" touchpad), so use angleDelta
int xDelta = event->angleDelta().x();
int yDelta = event->angleDelta().y();
+ // For a single "clicky" wheel event (angleDelta +/- 120),
+ // we want flick() to end up moving a distance proportional to QStyleHints::wheelScrollLines().
+ // The decel algo from there is
+ // qreal dist = v2 / (accel * 2.0);
+ // i.e. initialWheelFlickDistance = (120 / dt)^2 / (deceleration * 2)
+ // now solve for dt:
+ // dt = 120 / sqrt(deceleration * 2 * initialWheelFlickDistance)
+ if (!isMoving())
+ elapsed = 120 / qSqrt(d->deceleration * 2 * d->initialWheelFlickDistance);
if (yflick() && yDelta != 0) {
- bool valid = false;
- if (yDelta > 0 && contentY() > -minYExtent()) {
- d->vData.velocity = qMax(yDelta*2 - d->vData.smoothVelocity.value(), qreal(d->maxVelocity/4));
- valid = true;
- } else if (yDelta < 0 && contentY() < -maxYExtent()) {
- d->vData.velocity = qMin(yDelta*2 - d->vData.smoothVelocity.value(), qreal(-d->maxVelocity/4));
- valid = true;
- }
- if (valid) {
+ qreal instVelocity = yDelta / elapsed;
+ // if the direction has changed, start over with filtering, to allow instant movement in the opposite direction
+ if ((instVelocity < 0 && d->vData.velocity > 0) || (instVelocity > 0 && d->vData.velocity < 0))
+ d->vData.velocityBuffer.clear();
+ d->vData.addVelocitySample(instVelocity, d->maxVelocity);
+ d->vData.updateVelocity();
+ if ((yDelta > 0 && contentY() > -minYExtent()) || (yDelta < 0 && contentY() < -maxYExtent())) {
d->flickY(d->vData.velocity);
d->flickingStarted(false, true);
if (d->vData.flicking) {
@@ -1539,15 +1565,13 @@ void QQuickFlickable::wheelEvent(QWheelEvent *event)
}
}
if (xflick() && xDelta != 0) {
- bool valid = false;
- if (xDelta > 0 && contentX() > -minXExtent()) {
- d->hData.velocity = qMax(xDelta*2 - d->hData.smoothVelocity.value(), qreal(d->maxVelocity/4));
- valid = true;
- } else if (xDelta < 0 && contentX() < -maxXExtent()) {
- d->hData.velocity = qMin(xDelta*2 - d->hData.smoothVelocity.value(), qreal(-d->maxVelocity/4));
- valid = true;
- }
- if (valid) {
+ qreal instVelocity = xDelta / elapsed;
+ // if the direction has changed, start over with filtering, to allow instant movement in the opposite direction
+ if ((instVelocity < 0 && d->hData.velocity > 0) || (instVelocity > 0 && d->hData.velocity < 0))
+ d->hData.velocityBuffer.clear();
+ d->hData.addVelocitySample(instVelocity, d->maxVelocity);
+ d->hData.updateVelocity();
+ if ((xDelta > 0 && contentX() > -minXExtent()) || (xDelta < 0 && contentX() < -maxXExtent())) {
d->flickX(d->hData.velocity);
d->flickingStarted(true, false);
if (d->hData.flicking) {
@@ -1562,18 +1586,13 @@ void QQuickFlickable::wheelEvent(QWheelEvent *event)
int xDelta = event->pixelDelta().x();
int yDelta = event->pixelDelta().y();
- qreal elapsed = qreal(currentTimestamp - d->lastPosTime) / 1000.;
- if (elapsed <= 0) {
- d->lastPosTime = currentTimestamp;
- return;
- }
QVector2D velocity(xDelta / elapsed, yDelta / elapsed);
- d->lastPosTime = currentTimestamp;
d->accumulatedWheelPixelDelta += QVector2D(event->pixelDelta());
d->drag(currentTimestamp, event->type(), event->position(), d->accumulatedWheelPixelDelta,
true, !d->scrollingPhase, true, velocity);
event->accept();
}
+ d->lastPosTime = currentTimestamp;
if (!event->isAccepted())
QQuickItem::wheelEvent(event);
@@ -1744,6 +1763,10 @@ void QQuickFlickable::componentComplete()
setContentX(-minXExtent());
if (!d->vData.explicitValue && d->vData.startMargin != 0.)
setContentY(-minYExtent());
+ if (lcWheel().isDebugEnabled() || lcVel().isDebugEnabled()) {
+ d->timeline.setObjectName(QLatin1String("timeline for Flickable ") + objectName());
+ d->velocityTimeline.setObjectName(QLatin1String("velocity timeline for Flickable ") + objectName());
+ }
}
void QQuickFlickable::viewportMoved(Qt::Orientations orient)
@@ -2504,9 +2527,23 @@ void QQuickFlickable::setMaximumFlickVelocity(qreal v)
/*!
\qmlproperty real QtQuick::Flickable::flickDeceleration
- This property holds the rate at which a flick will decelerate.
-
- The default value is platform dependent.
+ This property holds the rate at which a flick will decelerate:
+ the higher the number, the faster it slows down when the user stops
+ flicking via touch, touchpad or mouse wheel. For example 0.0001 is nearly
+ "frictionless", and 10000 feels quite "sticky".
+
+ The default value is platform dependent. Values of zero or less are not allowed.
+
+ \note For touchpad flicking, some platforms drive Flickable directly by
+ sending QWheelEvents with QWheelEvent::phase() being \c Qt::ScrollMomentum,
+ after the user has released all fingers from the touchpad. In that case,
+ the operating system is controlling the deceleration, and this property has
+ no effect.
+
+ \note For mouse wheel scrolling, and for gesture scrolling on touchpads
+ that do not have a momentum phase, extremely large values of
+ flickDeceleration can make Flickable very resistant to scrolling,
+ especially if \l maximumFlickVelocity is too small.
*/
qreal QQuickFlickable::flickDeceleration() const
{
@@ -2519,7 +2556,7 @@ void QQuickFlickable::setFlickDeceleration(qreal deceleration)
Q_D(QQuickFlickable);
if (deceleration == d->deceleration)
return;
- d->deceleration = deceleration;
+ d->deceleration = qMax(0.001, deceleration);
emit flickDecelerationChanged();
}
diff --git a/src/quick/items/qquickflickable_p_p.h b/src/quick/items/qquickflickable_p_p.h
index 414c9c33d6..6163613493 100644
--- a/src/quick/items/qquickflickable_p_p.h
+++ b/src/quick/items/qquickflickable_p_p.h
@@ -241,6 +241,7 @@ public:
int pressDelay;
int fixupDuration;
qreal flickBoost;
+ qreal initialWheelFlickDistance;
enum FixupMode { Normal, Immediate, ExtentChanged };
FixupMode fixupMode;
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 75f1457816..dec0ae19ae 100644 index 75f1457816..dec0ae19ae 100644
--- a/src/quick/items/qquickitem.cpp --- a/src/quick/items/qquickitem.cpp
@@ -597,7 +419,7 @@ index 841d91bb40..ade8fb61f2 100644
enum DirtyType { enum DirtyType {
TransformOrigin = 0x00000001, TransformOrigin = 0x00000001,
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp
index 13e7b87049..f8ad168a17 100644 index 010a0152e1..f8ad168a17 100644
--- a/src/quick/items/qquickitemview.cpp --- a/src/quick/items/qquickitemview.cpp
+++ b/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp
@@ -1785,7 +1785,7 @@ void QQuickItemViewPrivate::refill(qreal from, qreal to) @@ -1785,7 +1785,7 @@ void QQuickItemViewPrivate::refill(qreal from, qreal to)
@@ -609,15 +431,6 @@ index 13e7b87049..f8ad168a17 100644
currentChanges.reset(); currentChanges.reset();
bufferedChanges.reset(); bufferedChanges.reset();
releaseVisibleItems(reusableFlag); releaseVisibleItems(reusableFlag);
@@ -2402,8 +2402,6 @@ void QQuickItemView::createdItem(int index, QObject* object)
d->repositionPackageItemAt(item, index);
else if (index == d->currentIndex)
d->updateCurrent(index);
- } else if (index == d->currentIndex) {
- d->updateCurrent(index);
}
}
diff --git a/src/quick/items/qquickmousearea_p_p.h b/src/quick/items/qquickmousearea_p_p.h diff --git a/src/quick/items/qquickmousearea_p_p.h b/src/quick/items/qquickmousearea_p_p.h
index fba383e268..0d63618622 100644 index fba383e268..0d63618622 100644
--- a/src/quick/items/qquickmousearea_p_p.h --- a/src/quick/items/qquickmousearea_p_p.h
@@ -638,44 +451,6 @@ index fba383e268..0d63618622 100644
QPointF startScene; QPointF startScene;
QPointF targetStartPos; QPointF targetStartPos;
QPointF lastPos; QPointF lastPos;
diff --git a/src/quick/items/qquickshadereffectsource.cpp b/src/quick/items/qquickshadereffectsource.cpp
index 4f61d61309..b298ed74da 100644
--- a/src/quick/items/qquickshadereffectsource.cpp
+++ b/src/quick/items/qquickshadereffectsource.cpp
@@ -344,7 +344,6 @@ void QQuickShaderEffectSource::setSourceItem(QQuickItem *item)
d->refFromEffectItem(m_hideSource);
d->addItemChangeListener(this, QQuickItemPrivate::Geometry);
connect(m_sourceItem, SIGNAL(destroyed(QObject*)), this, SLOT(sourceItemDestroyed(QObject*)));
- connect(m_sourceItem, SIGNAL(parentChanged(QQuickItem*)), this, SLOT(sourceItemParentChanged(QQuickItem*)));
} else {
qWarning("ShaderEffectSource: sourceItem and ShaderEffectSource must both be children of the same window.");
m_sourceItem = nullptr;
@@ -364,13 +363,6 @@ void QQuickShaderEffectSource::sourceItemDestroyed(QObject *item)
}
-void QQuickShaderEffectSource::sourceItemParentChanged(QQuickItem *parent)
-{
- if (!parent && m_texture)
- m_texture->setItem(0);
-}
-
-
/*!
\qmlproperty rect QtQuick::ShaderEffectSource::sourceRect
diff --git a/src/quick/items/qquickshadereffectsource_p.h b/src/quick/items/qquickshadereffectsource_p.h
index 4deb6c70a3..c0a1ccab78 100644
--- a/src/quick/items/qquickshadereffectsource_p.h
+++ b/src/quick/items/qquickshadereffectsource_p.h
@@ -173,7 +173,6 @@ Q_SIGNALS:
private Q_SLOTS:
void sourceItemDestroyed(QObject *item);
void invalidateSceneGraph();
- void sourceItemParentChanged(QQuickItem *parent);
protected:
void releaseResources() override;
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 6230186933..e823ca1095 100644 index 6230186933..e823ca1095 100644
--- a/src/quick/items/qquicktext.cpp --- a/src/quick/items/qquicktext.cpp
@@ -690,7 +465,7 @@ index 6230186933..e823ca1095 100644
\c Text.StyledText parser is strict, requiring tags to be correctly nested. \c Text.StyledText parser is strict, requiring tags to be correctly nested.
diff --git a/src/quick/scenegraph/qsgrhidistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgrhidistancefieldglyphcache.cpp diff --git a/src/quick/scenegraph/qsgrhidistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgrhidistancefieldglyphcache.cpp
index 53b6fe117f..219cdd5966 100644 index eb4db0f85e..2325a2665b 100644
--- a/src/quick/scenegraph/qsgrhidistancefieldglyphcache.cpp --- a/src/quick/scenegraph/qsgrhidistancefieldglyphcache.cpp
+++ b/src/quick/scenegraph/qsgrhidistancefieldglyphcache.cpp +++ b/src/quick/scenegraph/qsgrhidistancefieldglyphcache.cpp
@@ -446,7 +446,7 @@ bool QSGRhiDistanceFieldGlyphCache::loadPregeneratedCache(const QRawFont &font) @@ -446,7 +446,7 @@ bool QSGRhiDistanceFieldGlyphCache::loadPregeneratedCache(const QRawFont &font)
@@ -735,27 +510,6 @@ index d531fc9205..a25af90414 100644
else if (entity == QLatin1String("quot")) else if (entity == QLatin1String("quot"))
textOut += QChar(34); textOut += QChar(34);
else if (entity == QLatin1String("nbsp")) else if (entity == QLatin1String("nbsp"))
diff --git a/src/quick/util/qquicktimeline.cpp b/src/quick/util/qquicktimeline.cpp
index 7ec7c827eb..abe6eb7261 100644
--- a/src/quick/util/qquicktimeline.cpp
+++ b/src/quick/util/qquicktimeline.cpp
@@ -53,6 +53,8 @@
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcTl, "qt.quick.timeline")
+
struct Update {
Update(QQuickTimeLineValue *_g, qreal _v)
: g(_g), v(_v) {}
@@ -513,6 +515,7 @@ void QQuickTimeLine::reset(QQuickTimeLineValue &timeLineValue)
qWarning() << "QQuickTimeLine: Cannot reset a QQuickTimeLineValue owned by another timeline.";
return;
}
+ qCDebug(lcTl) << static_cast<QObject*>(this) << timeLineValue.value();
remove(&timeLineValue);
timeLineValue._t = nullptr;
}
diff --git a/src/quickwidgets/qaccessiblequickwidget.cpp b/src/quickwidgets/qaccessiblequickwidget.cpp diff --git a/src/quickwidgets/qaccessiblequickwidget.cpp b/src/quickwidgets/qaccessiblequickwidget.cpp
new file mode 100644 new file mode 100644
index 0000000000..8a1c901880 index 0000000000..8a1c901880
@@ -1377,6 +1131,63 @@ index 35f1e2c94d..1722447830 100644
QTEST_MAIN(tst_QQmlDelegateModel) QTEST_MAIN(tst_QQmlDelegateModel)
#include "tst_qqmldelegatemodel.moc" #include "tst_qqmldelegatemodel.moc"
diff --git a/tests/auto/qml/qqmllanguage/data/Broken.qml b/tests/auto/qml/qqmllanguage/data/Broken.qml
new file mode 100644
index 0000000000..e24d9112a8
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/Broken.qml
@@ -0,0 +1,5 @@
+import QtQml 2.15
+
+QtObject {
+ notThere: 5
+}
diff --git a/tests/auto/qml/qqmllanguage/data/asBroken.qml b/tests/auto/qml/qqmllanguage/data/asBroken.qml
new file mode 100644
index 0000000000..bd88d14c76
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/asBroken.qml
@@ -0,0 +1,6 @@
+import QtQml 2.15
+
+QtObject {
+ id: self
+ property var selfAsBroken: self as Broken
+}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index bffb62c59e..97cc64991f 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -336,6 +336,7 @@ private slots:
void bareInlineComponent();
void hangOnWarning();
+ void objectAsBroken();
void ambiguousContainingType();
@@ -5876,6 +5877,21 @@ void tst_qqmllanguage::ambiguousContainingType()
}
}
+void tst_qqmllanguage::objectAsBroken()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, testFileUrl("asBroken.qml"));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QScopedPointer<QObject> o(c.create());
+ QVERIFY(!o.isNull());
+ QVariant selfAsBroken = o->property("selfAsBroken");
+ QVERIFY(selfAsBroken.isValid());
+ // QCOMPARE(selfAsBroken.metaType(), QMetaType::fromType<std::nullptr_t>());
+
+ QQmlComponent b(&engine, testFileUrl("Broken.qml"));
+ QVERIFY(b.isError());
+}
+
QTEST_MAIN(tst_qqmllanguage)
#include "tst_qqmllanguage.moc"
diff --git a/tests/auto/qml/qv4mm/tst_qv4mm.cpp b/tests/auto/qml/qv4mm/tst_qv4mm.cpp diff --git a/tests/auto/qml/qv4mm/tst_qv4mm.cpp b/tests/auto/qml/qv4mm/tst_qv4mm.cpp
index 5d635aa63b..824fd89e5b 100644 index 5d635aa63b..824fd89e5b 100644
--- a/tests/auto/qml/qv4mm/tst_qv4mm.cpp --- a/tests/auto/qml/qv4mm/tst_qv4mm.cpp
@@ -1395,74 +1206,6 @@ index 5d635aa63b..824fd89e5b 100644
// engine2 doesn't own the object as engine1 was the first to wrap it above. // engine2 doesn't own the object as engine1 was the first to wrap it above.
// Therefore, no effect here. // Therefore, no effect here.
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index f3659290eb..9fa51da6f8 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -870,6 +870,7 @@ void tst_qquickflickable::wheel()
QVERIFY(flick != nullptr);
QQuickFlickablePrivate *fp = QQuickFlickablePrivate::get(flick);
QSignalSpy moveEndSpy(flick, SIGNAL(movementEnded()));
+ quint64 timestamp = 10;
// test a vertical flick
{
@@ -877,6 +878,7 @@ void tst_qquickflickable::wheel()
QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(), QPoint(0,-120),
Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
event.setAccepted(false);
+ event.setTimestamp(timestamp);
QGuiApplication::sendEvent(window.data(), &event);
}
@@ -887,6 +889,7 @@ void tst_qquickflickable::wheel()
QCOMPARE(fp->velocityTimeline.isActive(), false);
QCOMPARE(fp->timeline.isActive(), false);
QTest::qWait(50); // make sure that onContentYChanged won't sneak in again
+ timestamp += 50;
QCOMPARE(flick->property("movementsAfterEnd").value<int>(), 0); // QTBUG-55886
// get ready to test horizontal flick
@@ -900,8 +903,8 @@ void tst_qquickflickable::wheel()
QPoint pos(200, 200);
QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(), QPoint(-120,0),
Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
-
event.setAccepted(false);
+ event.setTimestamp(timestamp);
QGuiApplication::sendEvent(window.data(), &event);
}
@@ -926,11 +929,13 @@ void tst_qquickflickable::trackpad()
QVERIFY(flick != nullptr);
QSignalSpy moveEndSpy(flick, SIGNAL(movementEnded()));
QPoint pos(200, 200);
+ quint64 timestamp = 10;
{
QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(0,-100), QPoint(0,-120),
Qt::NoButton, Qt::NoModifier, Qt::ScrollBegin, false);
event.setAccepted(false);
+ event.setTimestamp(timestamp++);
QGuiApplication::sendEvent(window.data(), &event);
}
@@ -944,6 +949,7 @@ void tst_qquickflickable::trackpad()
QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(-100,0), QPoint(-120,0),
Qt::NoButton, Qt::NoModifier, Qt::ScrollUpdate, false);
event.setAccepted(false);
+ event.setTimestamp(timestamp++);
QGuiApplication::sendEvent(window.data(), &event);
}
@@ -954,6 +960,7 @@ void tst_qquickflickable::trackpad()
QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(0,0), QPoint(0,0),
Qt::NoButton, Qt::NoModifier, Qt::ScrollEnd, false);
event.setAccepted(false);
+ event.setTimestamp(timestamp++);
QGuiApplication::sendEvent(window.data(), &event);
}
diff --git a/tests/auto/quick/qquickitem2/data/activeFocusOnTab_infiniteLoop3.qml b/tests/auto/quick/qquickitem2/data/activeFocusOnTab_infiniteLoop3.qml diff --git a/tests/auto/quick/qquickitem2/data/activeFocusOnTab_infiniteLoop3.qml b/tests/auto/quick/qquickitem2/data/activeFocusOnTab_infiniteLoop3.qml
new file mode 100644 new file mode 100644
index 0000000000..889e480f3b index 0000000000..889e480f3b
@@ -1512,96 +1255,3 @@ index c8f251dbe1..c8ef36ee68 100644
void tst_QQuickItem::nextItemInFocusChain() void tst_QQuickItem::nextItemInFocusChain()
{ {
if (!qt_tab_all_widgets()) if (!qt_tab_all_widgets())
diff --git a/tests/auto/quick/qquicklistview/data/qtbug86744.qml b/tests/auto/quick/qquicklistview/data/qtbug86744.qml
deleted file mode 100644
index 6dc82d57eb..0000000000
--- a/tests/auto/quick/qquicklistview/data/qtbug86744.qml
+++ /dev/null
@@ -1,21 +0,0 @@
-import QtQuick 2.15
-import QtQml.Models 2.15
-
-Item {
- height: 200
- width: 100
- DelegateModel {
- id: dm
- model: 2
- delegate: Item {
- width: 100; height: 20
- property bool isCurrent: ListView.isCurrentItem
- }
- }
- ListView {
- objectName: "listView"
- model: dm
- currentIndex: 1
- anchors.fill: parent
- }
-}
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index df329f8318..b564fd3ba5 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -10201,20 +10201,6 @@ void tst_QQuickListView::dragDelegateWithMouseArea_data()
}
}
-void tst_QQuickListView::isCurrentItem_DelegateModel()
-{
- QScopedPointer<QQuickView> window(createView());
- window->setSource(testFileUrl("qtbug86744.qml"));
- window->resize(640, 480);
- window->show();
- QVERIFY(QTest::qWaitForWindowExposed(window.data()));
-
- QQuickListView* listView = window->rootObject()->findChild<QQuickListView*>("listView");
- QVERIFY(listView);
- QVariant value = listView->itemAtIndex(1)->property("isCurrent");
- QVERIFY(value.toBool() == true);
-}
-
QTEST_MAIN(tst_QQuickListView)
#include "tst_qquicklistview.moc"
diff --git a/tests/manual/touch/flicktext.qml b/tests/manual/touch/flicktext.qml
index 9e84261687..e69d6207a9 100644
--- a/tests/manual/touch/flicktext.qml
+++ b/tests/manual/touch/flicktext.qml
@@ -380,6 +380,36 @@ Rectangle {
text: "content X " + flick.contentX.toFixed(2) + " Y " + flick.contentY.toFixed(2)
}
}
+
+ Column {
+ Row {
+ spacing: 2
+ Examples.Button {
+ id: decrButton
+ text: "-"
+ onClicked: flick.flickDeceleration -= 100
+ Timer {
+ running: decrButton.pressed
+ interval: 100; repeat: true
+ onTriggered: flick.flickDeceleration -= 100
+ }
+ }
+ Text {
+ horizontalAlignment: Text.AlignHCenter
+ text: "decel:\n" + flick.flickDeceleration.toFixed(4)
+ }
+ Examples.Button {
+ id: incrButton
+ text: "+"
+ onClicked: flick.flickDeceleration += 100
+ }
+ Timer {
+ running: incrButton.pressed
+ interval: 100; repeat: true
+ onTriggered: flick.flickDeceleration += 100
+ }
+ }
+ }
}
Component.onCompleted: {
@@ -69,6 +69,13 @@
</Package--> </Package-->
<History> <History>
<Update release="36">
<Date>2023-02-15</Date>
<Version>5.15.7</Version>
<Comment>Version bump.</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="35"> <Update release="35">
<Date>2022-12-21</Date> <Date>2022-12-21</Date>
<Version>5.15.7</Version> <Version>5.15.7</Version>
@@ -488,7 +488,7 @@ index 25afff79..96f07bc3 100644
} }
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index f10c1f79..e8613ed8 100644 index f10c1f79..c01e238b 100644
--- a/src/client/qwaylanddisplay.cpp --- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp
@@ -85,10 +85,203 @@ @@ -85,10 +85,203 @@
@@ -778,24 +778,14 @@ index f10c1f79..e8613ed8 100644
- } - }
- -
- wl_display_flush(mDisplay); - wl_display_flush(mDisplay);
+ m_eventThread->readAndDispatchEvents(); -}
} -
-void QWaylandDisplay::blockingReadEvents() -void QWaylandDisplay::blockingReadEvents()
+// We have to wait until we have an eventDispatcher before creating the eventThread, -{
+// otherwise forceRoundTrip() may block inside _events_read() because eventThread is
+// polling.
+void QWaylandDisplay::initEventThread()
{
- if (wl_display_dispatch(mDisplay) < 0) - if (wl_display_dispatch(mDisplay) < 0)
- checkError(); - checkError();
-} -}
+ m_eventThread.reset( -
+ new EventThread(mDisplay, /* default queue */ nullptr, EventThread::EmitToDispatch));
+ connect(m_eventThread.get(), &EventThread::needReadAndDispatch, this,
+ &QWaylandDisplay::flushRequests, Qt::QueuedConnection);
+ m_eventThread->start();
-void QWaylandDisplay::destroyFrameQueue(const QWaylandDisplay::FrameQueue &q) -void QWaylandDisplay::destroyFrameQueue(const QWaylandDisplay::FrameQueue &q)
-{ -{
- QWriteLocker locker(&m_frameQueueLock); - QWriteLocker locker(&m_frameQueueLock);
@@ -807,6 +797,29 @@ index f10c1f79..e8613ed8 100644
- if (q.queue != nullptr) - if (q.queue != nullptr)
- wl_event_queue_destroy(q.queue); - wl_event_queue_destroy(q.queue);
- delete q.mutex; - delete q.mutex;
+ m_eventThread->readAndDispatchEvents();
}
-QWaylandDisplay::FrameQueue QWaylandDisplay::createFrameQueue()
+// We have to wait until we have an eventDispatcher before creating the eventThread,
+// otherwise forceRoundTrip() may block inside _events_read() because eventThread is
+// polling.
+void QWaylandDisplay::initEventThread()
{
- QWriteLocker locker(&m_frameQueueLock);
- FrameQueue q{createEventQueue()};
- mExternalQueues.append(q);
- return q;
-}
+ m_eventThread.reset(
+ new EventThread(mDisplay, /* default queue */ nullptr, EventThread::EmitToDispatch));
+ connect(m_eventThread.get(), &EventThread::needReadAndDispatch, this,
+ &QWaylandDisplay::flushRequests, Qt::QueuedConnection);
+ m_eventThread->start();
-wl_event_queue *QWaylandDisplay::createEventQueue()
-{
- return wl_display_create_queue(mDisplay);
+ // wl_display_disconnect() free this. + // wl_display_disconnect() free this.
+ m_frameEventQueue = wl_display_create_queue(mDisplay); + m_frameEventQueue = wl_display_create_queue(mDisplay);
+ m_frameEventQueueThread.reset( + m_frameEventQueueThread.reset(
@@ -814,19 +827,6 @@ index f10c1f79..e8613ed8 100644
+ m_frameEventQueueThread->start(); + m_frameEventQueueThread->start();
} }
-QWaylandDisplay::FrameQueue QWaylandDisplay::createFrameQueue()
-{
- QWriteLocker locker(&m_frameQueueLock);
- FrameQueue q{createEventQueue()};
- mExternalQueues.append(q);
- return q;
-}
-
-wl_event_queue *QWaylandDisplay::createEventQueue()
-{
- return wl_display_create_queue(mDisplay);
-}
-
-void QWaylandDisplay::dispatchQueueWhile(wl_event_queue *queue, std::function<bool ()> condition, int timeout) -void QWaylandDisplay::dispatchQueueWhile(wl_event_queue *queue, std::function<bool ()> condition, int timeout)
+void QWaylandDisplay::blockingReadEvents() +void QWaylandDisplay::blockingReadEvents()
{ {
@@ -878,7 +878,30 @@ index f10c1f79..e8613ed8 100644
#endif #endif
} else if (interface == QStringLiteral("qt_surface_extension")) { } else if (interface == QStringLiteral("qt_surface_extension")) {
mWindowExtension.reset(new QtWayland::qt_surface_extension(registry, id, 1)); mWindowExtension.reset(new QtWayland::qt_surface_extension(registry, id, 1));
@@ -452,9 +598,10 @@ void QWaylandDisplay::addRegistryListener(RegistryListener listener, void *data) @@ -369,6 +515,8 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
#if QT_CONFIG(wayland_client_primary_selection)
} else if (interface == QStringLiteral("zwp_primary_selection_device_manager_v1")) {
mPrimarySelectionManager.reset(new QWaylandPrimarySelectionDeviceManagerV1(this, id, 1));
+ for (QWaylandInputDevice *inputDevice : qAsConst(mInputDevices))
+ inputDevice->setPrimarySelectionDevice(mPrimarySelectionManager->createDevice(inputDevice));
#endif
} else if (interface == QStringLiteral("zwp_text_input_manager_v2") && !mClientSideInputContextRequested) {
mTextInputManager.reset(new QtWayland::zwp_text_input_manager_v2(registry, id, 1));
@@ -427,6 +575,13 @@ void QWaylandDisplay::registry_global_remove(uint32_t id)
inputDevice->setTextInput(nullptr);
mWaylandIntegration->reconfigureInputContext();
}
+#if QT_CONFIG(wayland_client_primary_selection)
+ if (global.interface == QStringLiteral("zwp_primary_selection_device_manager_v1")) {
+ mPrimarySelectionManager.reset();
+ for (QWaylandInputDevice *inputDevice : qAsConst(mInputDevices))
+ inputDevice->setPrimarySelectionDevice(nullptr);
+ }
+#endif
mGlobals.removeAt(i);
break;
}
@@ -452,9 +607,10 @@ void QWaylandDisplay::addRegistryListener(RegistryListener listener, void *data)
void QWaylandDisplay::removeListener(RegistryListener listener, void *data) void QWaylandDisplay::removeListener(RegistryListener listener, void *data)
{ {
@@ -890,7 +913,7 @@ index f10c1f79..e8613ed8 100644
} }
uint32_t QWaylandDisplay::currentTimeMillisec() uint32_t QWaylandDisplay::currentTimeMillisec()
@@ -467,50 +614,9 @@ uint32_t QWaylandDisplay::currentTimeMillisec() @@ -467,50 +623,9 @@ uint32_t QWaylandDisplay::currentTimeMillisec()
return 0; return 0;
} }
@@ -942,7 +965,7 @@ index f10c1f79..e8613ed8 100644
} }
bool QWaylandDisplay::supportsWindowDecoration() const bool QWaylandDisplay::supportsWindowDecoration() const
@@ -574,14 +680,10 @@ void QWaylandDisplay::handleKeyboardFocusChanged(QWaylandInputDevice *inputDevic @@ -574,14 +689,10 @@ void QWaylandDisplay::handleKeyboardFocusChanged(QWaylandInputDevice *inputDevic
if (mLastKeyboardFocus == keyboardFocus) if (mLastKeyboardFocus == keyboardFocus)
return; return;
@@ -961,7 +984,7 @@ index f10c1f79..e8613ed8 100644
mLastKeyboardFocus = keyboardFocus; mLastKeyboardFocus = keyboardFocus;
} }
@@ -600,6 +702,19 @@ void QWaylandDisplay::handleWaylandSync() @@ -600,6 +711,19 @@ void QWaylandDisplay::handleWaylandSync()
QWindow *activeWindow = mActiveWindows.empty() ? nullptr : mActiveWindows.last()->window(); QWindow *activeWindow = mActiveWindows.empty() ? nullptr : mActiveWindows.last()->window();
if (activeWindow != QGuiApplication::focusWindow()) if (activeWindow != QGuiApplication::focusWindow())
QWindowSystemInterface::handleWindowActivated(activeWindow); QWindowSystemInterface::handleWindowActivated(activeWindow);
@@ -981,7 +1004,7 @@ index f10c1f79..e8613ed8 100644
} }
const wl_callback_listener QWaylandDisplay::syncCallbackListener = { const wl_callback_listener QWaylandDisplay::syncCallbackListener = {
@@ -626,6 +741,13 @@ QWaylandInputDevice *QWaylandDisplay::defaultInputDevice() const @@ -626,6 +750,13 @@ QWaylandInputDevice *QWaylandDisplay::defaultInputDevice() const
return mInputDevices.isEmpty() ? 0 : mInputDevices.first(); return mInputDevices.isEmpty() ? 0 : mInputDevices.first();
} }
@@ -995,7 +1018,7 @@ index f10c1f79..e8613ed8 100644
#if QT_CONFIG(cursor) #if QT_CONFIG(cursor)
QWaylandCursor *QWaylandDisplay::waylandCursor() QWaylandCursor *QWaylandDisplay::waylandCursor()
@@ -652,4 +774,6 @@ QWaylandCursorTheme *QWaylandDisplay::loadCursorTheme(const QString &name, int p @@ -652,4 +783,6 @@ QWaylandCursorTheme *QWaylandDisplay::loadCursorTheme(const QString &name, int p
} // namespace QtWaylandClient } // namespace QtWaylandClient
@@ -1173,28 +1196,21 @@ index 474fe2ab..46f629ac 100644
private: private:
QWaylandDisplay *m_display = nullptr; QWaylandDisplay *m_display = nullptr;
diff --git a/src/client/qwaylandinputcontext.cpp b/src/client/qwaylandinputcontext.cpp
index 8b79c08f..84a34674 100644
--- a/src/client/qwaylandinputcontext.cpp
+++ b/src/client/qwaylandinputcontext.cpp
@@ -387,8 +387,10 @@ void QWaylandTextInput::zwp_text_input_v2_input_method_changed(uint32_t serial,
Qt::KeyboardModifiers QWaylandTextInput::modifiersToQtModifiers(uint32_t modifiers)
{
Qt::KeyboardModifiers ret = Qt::NoModifier;
- for (int i = 0; modifiers >>= 1; ++i) {
- ret |= m_modifiersMap[i];
+ for (int i = 0; i < m_modifiersMap.size(); ++i) {
+ if (modifiers & (1 << i)) {
+ ret |= m_modifiersMap[i];
+ }
}
return ret;
}
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index 613fe862..4b90de84 100644 index 613fe862..4bea321e 100644
--- a/src/client/qwaylandinputdevice.cpp --- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp
@@ -685,6 +685,11 @@ public: @@ -308,8 +308,7 @@ void QWaylandInputDevice::Pointer::updateCursor()
auto shape = seat()->mCursor.shape;
if (shape == Qt::BlankCursor) {
- if (mCursor.surface)
- mCursor.surface->hide();
+ getOrCreateCursorSurface()->hide();
return;
}
@@ -685,6 +684,11 @@ public:
void QWaylandInputDevice::Pointer::pointer_leave(uint32_t time, struct wl_surface *surface) void QWaylandInputDevice::Pointer::pointer_leave(uint32_t time, struct wl_surface *surface)
{ {
@@ -1206,7 +1222,7 @@ index 613fe862..4b90de84 100644
// The event may arrive after destroying the window, indicated by // The event may arrive after destroying the window, indicated by
// a null surface. // a null surface.
if (!surface) if (!surface)
@@ -696,11 +701,6 @@ void QWaylandInputDevice::Pointer::pointer_leave(uint32_t time, struct wl_surfac @@ -696,11 +700,6 @@ void QWaylandInputDevice::Pointer::pointer_leave(uint32_t time, struct wl_surfac
if (!QWaylandWindow::mouseGrab()) if (!QWaylandWindow::mouseGrab())
setFrameEvent(new LeaveEvent(window, mSurfacePos, mGlobalPos)); setFrameEvent(new LeaveEvent(window, mSurfacePos, mGlobalPos));
@@ -1218,7 +1234,7 @@ index 613fe862..4b90de84 100644
} }
class MotionEvent : public QWaylandPointerEvent class MotionEvent : public QWaylandPointerEvent
@@ -1300,14 +1300,6 @@ void QWaylandInputDevice::Keyboard::handleFocusDestroyed() @@ -1300,14 +1299,6 @@ void QWaylandInputDevice::Keyboard::handleFocusDestroyed()
void QWaylandInputDevice::Keyboard::handleFocusLost() void QWaylandInputDevice::Keyboard::handleFocusLost()
{ {
mFocus = nullptr; mFocus = nullptr;
@@ -1233,7 +1249,7 @@ index 613fe862..4b90de84 100644
mParent->mQDisplay->handleKeyboardFocusChanged(mParent); mParent->mQDisplay->handleKeyboardFocusChanged(mParent);
mRepeatTimer.stop(); mRepeatTimer.stop();
} }
@@ -1396,6 +1388,7 @@ void QWaylandInputDevice::Touch::touch_cancel() @@ -1396,6 +1387,7 @@ void QWaylandInputDevice::Touch::touch_cancel()
if (touchExt) if (touchExt)
touchExt->touchCanceled(); touchExt->touchCanceled();
@@ -1315,6 +1331,22 @@ index ff70ae25..73b80658 100644
QList<int> possibleKeys(const QKeyEvent *event) const override; QList<int> possibleKeys(const QKeyEvent *event) const override;
QStringList themeNames() const override; QStringList themeNames() const override;
diff --git a/src/client/qwaylandprimaryselectionv1.cpp b/src/client/qwaylandprimaryselectionv1.cpp
index 832f9678..ea508771 100644
--- a/src/client/qwaylandprimaryselectionv1.cpp
+++ b/src/client/qwaylandprimaryselectionv1.cpp
@@ -54,11 +54,6 @@ QWaylandPrimarySelectionDeviceManagerV1::QWaylandPrimarySelectionDeviceManagerV1
: zwp_primary_selection_device_manager_v1(display->wl_registry(), id, qMin(version, uint(1)))
, m_display(display)
{
- // Create devices for all seats.
- // This only works if we get the global before all devices
- const auto seats = m_display->inputDevices();
- for (auto *seat : seats)
- seat->setPrimarySelectionDevice(createDevice(seat));
}
QWaylandPrimarySelectionDeviceV1 *QWaylandPrimarySelectionDeviceManagerV1::createDevice(QWaylandInputDevice *seat)
diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp
index 6cb337de..5537dafd 100644 index 6cb337de..5537dafd 100644
--- a/src/client/qwaylandscreen.cpp --- a/src/client/qwaylandscreen.cpp
@@ -1433,7 +1465,7 @@ index df1c94f2..050cfdc0 100644
#if QT_CONFIG(cursor) #if QT_CONFIG(cursor)
diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp
index dc7ff670..98acd42d 100644 index dc7ff670..41cffdf7 100644
--- a/src/client/qwaylandshmbackingstore.cpp --- a/src/client/qwaylandshmbackingstore.cpp
+++ b/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp
@@ -52,6 +52,7 @@ @@ -52,6 +52,7 @@
@@ -1454,11 +1486,13 @@ index dc7ff670..98acd42d 100644
#endif #endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@@ -75,7 +79,9 @@ QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display, @@ -74,8 +78,10 @@ QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display,
int alloc = stride * size.height();
int fd = -1; int fd = -1;
#ifdef SYS_memfd_create -#ifdef SYS_memfd_create
- fd = syscall(SYS_memfd_create, "wayland-shm", MFD_CLOEXEC); - fd = syscall(SYS_memfd_create, "wayland-shm", MFD_CLOEXEC);
+#if defined(SYS_memfd_create) && defined(F_SEAL_SEAL)
+ fd = syscall(SYS_memfd_create, "wayland-shm", MFD_CLOEXEC | MFD_ALLOW_SEALING); + fd = syscall(SYS_memfd_create, "wayland-shm", MFD_CLOEXEC | MFD_ALLOW_SEALING);
+ if (fd >= 0) + if (fd >= 0)
+ fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL); + fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL);
@@ -1466,7 +1500,7 @@ index dc7ff670..98acd42d 100644
QScopedPointer<QFile> filePointer; QScopedPointer<QFile> filePointer;
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index afdebf55..fb2c59dc 100644 index cb82857a..fb2c59dc 100644
--- a/src/client/qwaylandwindow.cpp --- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp
@@ -76,7 +76,6 @@ QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr; @@ -76,7 +76,6 @@ QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr;
@@ -1719,15 +1753,6 @@ index afdebf55..fb2c59dc 100644
if (mWaitingForFrameCallback) { if (mWaitingForFrameCallback) {
qCDebug(lcWaylandBackingstore) << "Didn't receive frame callback in time, window should now be inexposed"; qCDebug(lcWaylandBackingstore) << "Didn't receive frame callback in time, window should now be inexposed";
@@ -821,7 +831,7 @@ bool QWaylandWindow::createDecoration()
decoration = false;
if (mSubSurfaceWindow)
decoration = false;
- if (mShellSurface && !mShellSurface->wantsDecorations())
+ if (!mShellSurface || !mShellSurface->wantsDecorations())
decoration = false;
bool hadDecoration = mWindowDecoration;
@@ -868,6 +878,17 @@ bool QWaylandWindow::createDecoration() @@ -868,6 +878,17 @@ bool QWaylandWindow::createDecoration()
subsurf->set_position(pos.x() + m.left(), pos.y() + m.top()); subsurf->set_position(pos.x() + m.left(), pos.y() + m.top());
} }
@@ -2308,7 +2333,7 @@ index 261f8cbb..c1bcd5c6 100644
private: private:
QScopedPointer<QWaylandXdgShellV6> m_xdgShell; QScopedPointer<QWaylandXdgShellV6> m_xdgShell;
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
index 3a1569f7..79177540 100644 index f3e3c330..67342b0c 100644
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp
@@ -67,11 +67,6 @@ QWaylandXdgSurface::Toplevel::Toplevel(QWaylandXdgSurface *xdgSurface) @@ -67,11 +67,6 @@ QWaylandXdgSurface::Toplevel::Toplevel(QWaylandXdgSurface *xdgSurface)
@@ -2409,7 +2434,20 @@ index 3a1569f7..79177540 100644
} }
QWaylandXdgSurface::~QWaylandXdgSurface() QWaylandXdgSurface::~QWaylandXdgSurface()
@@ -399,8 +411,6 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent) @@ -372,10 +384,10 @@ void QWaylandXdgSurface::setSizeHints()
const int minHeight = qMax(0, m_window->windowMinimumSize().height());
m_toplevel->set_min_size(minWidth, minHeight);
- int maxWidth = qMax(0, m_window->windowMaximumSize().width());
+ int maxWidth = qMax(minWidth, m_window->windowMaximumSize().width());
if (maxWidth == QWINDOWSIZE_MAX)
maxWidth = 0;
- int maxHeight = qMax(0, m_window->windowMaximumSize().height());
+ int maxHeight = qMax(minHeight, m_window->windowMaximumSize().height());
if (maxHeight == QWINDOWSIZE_MAX)
maxHeight = 0;
m_toplevel->set_max_size(maxWidth, maxHeight);
@@ -400,8 +412,6 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent)
{ {
Q_ASSERT(!m_toplevel && !m_popup); Q_ASSERT(!m_toplevel && !m_popup);
@@ -2418,7 +2456,7 @@ index 3a1569f7..79177540 100644
auto positioner = new QtWayland::xdg_positioner(m_shell->create_positioner()); auto positioner = new QtWayland::xdg_positioner(m_shell->create_positioner());
// set_popup expects a position relative to the parent // set_popup expects a position relative to the parent
QPoint transientPos = m_window->geometry().topLeft(); // this is absolute QPoint transientPos = m_window->geometry().topLeft(); // this is absolute
@@ -413,8 +423,9 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent) @@ -414,8 +424,9 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent)
positioner->set_anchor(QtWayland::xdg_positioner::anchor_top_left); positioner->set_anchor(QtWayland::xdg_positioner::anchor_top_left);
positioner->set_gravity(QtWayland::xdg_positioner::gravity_bottom_right); positioner->set_gravity(QtWayland::xdg_positioner::gravity_bottom_right);
positioner->set_size(m_window->geometry().width(), m_window->geometry().height()); positioner->set_size(m_window->geometry().width(), m_window->geometry().height());
@@ -2429,7 +2467,7 @@ index 3a1569f7..79177540 100644
delete positioner; delete positioner;
} }
@@ -436,6 +447,23 @@ void QWaylandXdgSurface::setGrabPopup(QWaylandWindow *parent, QWaylandInputDevic @@ -437,6 +448,23 @@ void QWaylandXdgSurface::setGrabPopup(QWaylandWindow *parent, QWaylandInputDevic
} }
setPopup(parent); setPopup(parent);
m_popup->grab(device, serial); m_popup->grab(device, serial);
@@ -2454,7 +2492,7 @@ index 3a1569f7..79177540 100644
void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial) void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial)
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
index 0c98be35..28ff76ba 100644 index 96785205..4b518f0a 100644
--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
+++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h
@@ -131,14 +131,15 @@ private: @@ -131,14 +131,15 @@ private:
@@ -85,6 +85,13 @@
</Package> </Package>
<History> <History>
<Update release="32">
<Date>2023-02-15</Date>
<Version>5.15.7</Version>
<Comment>Rebuild.</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="31"> <Update release="31">
<Date>2022-12-21</Date> <Date>2022-12-21</Date>
<Version>5.15.7</Version> <Version>5.15.7</Version>