Compare commits

...

9 Commits
master ... f24

Author SHA1 Message Date
Rex Dieter 024ab7a0f4 pull in recommended qtdbus patches 2017-05-08 10:00:09 -05:00
Rex Dieter 425885b3cd macros.qt5: +%_qt5_qmldir macro
pull in xcb-related upstream fixes
backport hidpi-related patches from f25 branch
2017-02-13 13:33:12 -06:00
Rex Dieter 3a8fd71ba6 BR: perl-generators 2016-12-07 10:21:02 -06:00
Rex Dieter edeff1b640 Revert "+qt5-srpm-macros"
This reverts commit 8d54bf0fcb.

Generating this from qt5 module instead
2016-11-16 11:11:34 -06:00
Rex Dieter 8d54bf0fcb +qt5-srpm-macros 2016-11-16 10:46:45 -06:00
Rex Dieter 8723a0d67a sync patches 2016-11-16 10:25:36 -06:00
Rex Dieter b30ae9f982 5.6.2 2016-11-16 09:56:49 -06:00
Rex Dieter 01c7f9ab08 cmake3 available only in epel 2016-09-27 09:09:57 -05:00
Rex Dieter c3879d9ba5 qt5-rpm-macros: Requires: cmake(3) 2016-08-02 08:15:13 -05:00
32 changed files with 1629 additions and 466 deletions

7
.gitignore vendored
View File

@ -1,6 +1 @@
/qtbase-opensource-src-5.5.1.tar.xz
/qtbase-opensource-src-5.6.0-beta.tar.gz
/qtbase-opensource-src-5.6.0-rc.tar.xz
/sources
/qtbase-opensource-src-5.6.0.tar.xz
/qtbase-opensource-src-5.6.1.tar.xz
/qtbase-opensource-src-5.6.2.tar.xz

View File

@ -0,0 +1,403 @@
From ca1ba9162d28bd07c39238bbd0c891e54a46e4be Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Thu, 28 Apr 2016 15:00:58 -0700
Subject: [PATCH 1/2] Merge the QDBusMetaType's custom information to
QDBusConnectionManager
This allows us to get rid of two Q_GLOBAL_STATIC in QtDBus, which means
fewer opportunities for screwing up the order of destruction. And since
QDBusConnectionManager now ensures that the types are initialized, we
don't need to re-initialize them everywhere.
The Q_GLOBAL_STATIC for QDBusConnectionManager ensures the proper
thread-safe locking, so we don't need to lock for every type that we're
trying to register. This should make things faster.
But as a side-effect, trying to register a D-Bus metatype will cause the
QDBusConnectionManager thread to start too.
Change-Id: Ifea6e497f11a461db432ffff1449a4e535234485
---
src/dbus/qdbusconnection.cpp | 1 +
src/dbus/qdbusconnectionmanager_p.h | 3 +-
src/dbus/qdbusintegrator.cpp | 1 -
src/dbus/qdbusmetatype.cpp | 182 +++++++++++++++++++-----------------
src/dbus/qdbusmetatype_p.h | 27 +++++-
5 files changed, 124 insertions(+), 90 deletions(-)
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
index 34b3da7..4db6396 100644
--- a/src/dbus/qdbusconnection.cpp
+++ b/src/dbus/qdbusconnection.cpp
@@ -193,6 +193,7 @@ void QDBusConnectionManager::run()
}
}
connectionHash.clear();
+ customTypes.clear();
// allow deletion from any thread without warning
moveToThread(Q_NULLPTR);
diff --git a/src/dbus/qdbusconnectionmanager_p.h b/src/dbus/qdbusconnectionmanager_p.h
index c0ab48e..97ecc74 100644
--- a/src/dbus/qdbusconnectionmanager_p.h
+++ b/src/dbus/qdbusconnectionmanager_p.h
@@ -48,13 +48,14 @@
#define QDBUSCONNECTIONMANAGER_P_H
#include "qdbusconnection_p.h"
+#include "qdbusmetatype_p.h"
#include "private/qthread_p.h"
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
-class QDBusConnectionManager : public QDaemonThread
+class QDBusConnectionManager : public QDaemonThread, public QDBusMetaTypeId
{
Q_OBJECT
struct ConnectionRequestData;
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 3be775d..37d2ae1 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -1019,7 +1019,6 @@ QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p)
qdbusThreadDebug = qdbusDefaultThreadDebug;
#endif
- QDBusMetaTypeId::init();
connect(this, &QDBusConnectionPrivate::dispatchStatusChanged,
this, &QDBusConnectionPrivate::doDispatch, Qt::QueuedConnection);
connect(this, &QDBusConnectionPrivate::spyHooksFinished,
diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp
index 2aaf0e2..1774b85 100644
--- a/src/dbus/qdbusmetatype.cpp
+++ b/src/dbus/qdbusmetatype.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2016 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtDBus module of the Qt Toolkit.
@@ -33,19 +34,15 @@
#include "qdbusmetatype.h"
#include "qdbusmetatype_p.h"
-
-#include <string.h>
#include "qdbus_symbols_p.h"
-#include <qbytearray.h>
-#include <qglobal.h>
-#include <qreadwritelock.h>
-#include <qvector.h>
+#include <string.h>
#include "qdbusargument_p.h"
#include "qdbusutil_p.h"
#include "qdbusunixfiledescriptor.h"
#ifndef QT_BOOTSTRAPPED
+#include "qdbusconnectionmanager_p.h"
#include "qdbusmessage.h"
#endif
@@ -58,82 +55,72 @@
QT_BEGIN_NAMESPACE
-class QDBusCustomTypeInfo
-{
-public:
- QDBusCustomTypeInfo() : signature(), marshall(0), demarshall(0)
- { }
-
- // Suggestion:
- // change 'signature' to char* and make QDBusCustomTypeInfo a Movable type
- QByteArray signature;
- QDBusMetaType::MarshallFunction marshall;
- QDBusMetaType::DemarshallFunction demarshall;
-};
+static void registerMarshallOperatorsNoLock(QVector<QDBusCustomTypeInfo> &ct, int id,
+ QDBusMetaType::MarshallFunction mf,
+ QDBusMetaType::DemarshallFunction df);
template<typename T>
-inline static void registerHelper(T * = 0)
+inline static void registerHelper(QVector<QDBusCustomTypeInfo> &ct)
{
void (*mf)(QDBusArgument &, const T *) = qDBusMarshallHelper<T>;
void (*df)(const QDBusArgument &, T *) = qDBusDemarshallHelper<T>;
- QDBusMetaType::registerMarshallOperators(qMetaTypeId<T>(),
+ registerMarshallOperatorsNoLock(ct, qMetaTypeId<T>(),
reinterpret_cast<QDBusMetaType::MarshallFunction>(mf),
reinterpret_cast<QDBusMetaType::DemarshallFunction>(df));
}
-void QDBusMetaTypeId::init()
+QDBusMetaTypeId *QDBusMetaTypeId::instance()
+{
+#ifdef QT_BOOTSTRAPPED
+ static QDBusMetaTypeId self;
+ return &self;
+#else
+ return QDBusConnectionManager::instance();
+#endif
+}
+
+QDBusMetaTypeId::QDBusMetaTypeId()
{
- static QBasicAtomicInt initialized = Q_BASIC_ATOMIC_INITIALIZER(false);
-
- // reentrancy is not a problem since everything else is locked on their own
- // set the guard variable at the end
- if (!initialized.load()) {
- // register our types with Qt Core (calling qMetaTypeId<T>() does this implicitly)
- (void)message();
- (void)argument();
- (void)variant();
- (void)objectpath();
- (void)signature();
- (void)error();
- (void)unixfd();
+ // register our types with Qt Core (calling qMetaTypeId<T>() does this implicitly)
+ (void)message();
+ (void)argument();
+ (void)variant();
+ (void)objectpath();
+ (void)signature();
+ (void)error();
+ (void)unixfd();
#ifndef QDBUS_NO_SPECIALTYPES
- // and register Qt Core's with us
- registerHelper<QDate>();
- registerHelper<QTime>();
- registerHelper<QDateTime>();
- registerHelper<QRect>();
- registerHelper<QRectF>();
- registerHelper<QSize>();
- registerHelper<QSizeF>();
- registerHelper<QPoint>();
- registerHelper<QPointF>();
- registerHelper<QLine>();
- registerHelper<QLineF>();
- registerHelper<QVariantList>();
- registerHelper<QVariantMap>();
- registerHelper<QVariantHash>();
-
- qDBusRegisterMetaType<QList<bool> >();
- qDBusRegisterMetaType<QList<short> >();
- qDBusRegisterMetaType<QList<ushort> >();
- qDBusRegisterMetaType<QList<int> >();
- qDBusRegisterMetaType<QList<uint> >();
- qDBusRegisterMetaType<QList<qlonglong> >();
- qDBusRegisterMetaType<QList<qulonglong> >();
- qDBusRegisterMetaType<QList<double> >();
- qDBusRegisterMetaType<QList<QDBusObjectPath> >();
- qDBusRegisterMetaType<QList<QDBusSignature> >();
- qDBusRegisterMetaType<QList<QDBusUnixFileDescriptor> >();
+ // and register Qt Core's with us
+ registerHelper<QDate>(customTypes);
+ registerHelper<QTime>(customTypes);
+ registerHelper<QDateTime>(customTypes);
+ registerHelper<QRect>(customTypes);
+ registerHelper<QRectF>(customTypes);
+ registerHelper<QSize>(customTypes);
+ registerHelper<QSizeF>(customTypes);
+ registerHelper<QPoint>(customTypes);
+ registerHelper<QPointF>(customTypes);
+ registerHelper<QLine>(customTypes);
+ registerHelper<QLineF>(customTypes);
+ registerHelper<QVariantList>(customTypes);
+ registerHelper<QVariantMap>(customTypes);
+ registerHelper<QVariantHash>(customTypes);
+
+ registerHelper<QList<bool> >(customTypes);
+ registerHelper<QList<short> >(customTypes);
+ registerHelper<QList<ushort> >(customTypes);
+ registerHelper<QList<int> >(customTypes);
+ registerHelper<QList<uint> >(customTypes);
+ registerHelper<QList<qlonglong> >(customTypes);
+ registerHelper<QList<qulonglong> >(customTypes);
+ registerHelper<QList<double> >(customTypes);
+ registerHelper<QList<QDBusObjectPath> >(customTypes);
+ registerHelper<QList<QDBusSignature> >(customTypes);
+ registerHelper<QList<QDBusUnixFileDescriptor> >(customTypes);
#endif
-
- initialized.store(true);
- }
}
-Q_GLOBAL_STATIC(QVector<QDBusCustomTypeInfo>, customTypes)
-Q_GLOBAL_STATIC(QReadWriteLock, customTypesLock)
-
/*!
\class QDBusMetaType
\inmodule QtDBus
@@ -203,14 +190,22 @@ void QDBusMetaType::registerMarshallOperators(int id, MarshallFunction mf,
DemarshallFunction df)
{
QByteArray var;
- QVector<QDBusCustomTypeInfo> *ct = customTypes();
- if (id < 0 || !mf || !df || !ct)
+ QDBusMetaTypeId *mgr = QDBusMetaTypeId::instance();
+ if (id < 0 || !mf || !df || !mgr)
return; // error!
- QWriteLocker locker(customTypesLock());
- if (id >= ct->size())
- ct->resize(id + 1);
- QDBusCustomTypeInfo &info = (*ct)[id];
+ QWriteLocker locker(&mgr->customTypesLock);
+ QVector<QDBusCustomTypeInfo> &ct = mgr->customTypes;
+ registerMarshallOperatorsNoLock(ct, id, mf, df);
+}
+
+static void registerMarshallOperatorsNoLock(QVector<QDBusCustomTypeInfo> &ct, int id,
+ QDBusMetaType::MarshallFunction mf,
+ QDBusMetaType::DemarshallFunction df)
+{
+ if (id >= ct.size())
+ ct.resize(id + 1);
+ QDBusCustomTypeInfo &info = ct[id];
info.marshall = mf;
info.demarshall = df;
}
@@ -227,12 +222,16 @@ bool QDBusMetaType::marshall(QDBusArgument &arg, int id, const void *data)
MarshallFunction mf;
{
- QReadLocker locker(customTypesLock());
- QVector<QDBusCustomTypeInfo> *ct = customTypes();
- if (id >= ct->size())
+ const QDBusMetaTypeId *mgr = QDBusMetaTypeId::instance();
+ if (!mgr)
+ return false; // shutting down
+
+ QReadLocker locker(&mgr->customTypesLock);
+ const QVector<QDBusCustomTypeInfo> &ct = mgr->customTypes;
+ if (id >= ct.size())
return false; // non-existent
- const QDBusCustomTypeInfo &info = (*ct).at(id);
+ const QDBusCustomTypeInfo &info = ct.at(id);
if (!info.marshall) {
mf = 0; // make gcc happy
return false;
@@ -256,12 +255,16 @@ bool QDBusMetaType::demarshall(const QDBusArgument &arg, int id, void *data)
DemarshallFunction df;
{
- QReadLocker locker(customTypesLock());
- QVector<QDBusCustomTypeInfo> *ct = customTypes();
- if (id >= ct->size())
+ const QDBusMetaTypeId *mgr = QDBusMetaTypeId::instance();
+ if (!mgr)
+ return false; // shutting down
+
+ QReadLocker locker(&mgr->customTypesLock);
+ const QVector<QDBusCustomTypeInfo> &ct = mgr->customTypes;
+ if (id >= ct.size())
return false; // non-existent
- const QDBusCustomTypeInfo &info = (*ct).at(id);
+ const QDBusCustomTypeInfo &info = ct.at(id);
if (!info.demarshall) {
df = 0; // make gcc happy
return false;
@@ -431,13 +434,17 @@ const char *QDBusMetaType::typeToSignature(int type)
return DBUS_TYPE_UNIX_FD_AS_STRING;
// try the database
- QVector<QDBusCustomTypeInfo> *ct = customTypes();
+ QDBusMetaTypeId *mgr = QDBusMetaTypeId::instance();
+ if (!mgr)
+ return Q_NULLPTR; // shutting down
+
{
- QReadLocker locker(customTypesLock());
- if (type >= ct->size())
+ QReadLocker locker(&mgr->customTypesLock);
+ const QVector<QDBusCustomTypeInfo> &ct = mgr->customTypes;
+ if (type >= ct.size())
return 0; // type not registered with us
- const QDBusCustomTypeInfo &info = (*ct).at(type);
+ const QDBusCustomTypeInfo &info = ct.at(type);
if (!info.signature.isNull())
return info.signature;
@@ -454,8 +461,9 @@ const char *QDBusMetaType::typeToSignature(int type)
QByteArray signature = QDBusArgumentPrivate::createSignature(type);
// re-acquire lock
- QWriteLocker locker(customTypesLock());
- info = &(*ct)[type];
+ QWriteLocker locker(&mgr->customTypesLock);
+ QVector<QDBusCustomTypeInfo> &ct = mgr->customTypes;
+ info = &ct[type];
info->signature = signature;
}
return info->signature;
diff --git a/src/dbus/qdbusmetatype_p.h b/src/dbus/qdbusmetatype_p.h
index 348fc6c..24c8326 100644
--- a/src/dbus/qdbusmetatype_p.h
+++ b/src/dbus/qdbusmetatype_p.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2016 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtDBus module of the Qt Toolkit.
@@ -53,10 +54,27 @@
#include <qdbuserror.h>
#include <qdbusunixfiledescriptor.h>
+#include <qbytearray.h>
+#include <qreadwritelock.h>
+#include <qvector.h>
+
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
+class QDBusCustomTypeInfo
+{
+public:
+ QDBusCustomTypeInfo() : signature(), marshall(0), demarshall(0)
+ { }
+
+ // Suggestion:
+ // change 'signature' to char* and make QDBusCustomTypeInfo a Movable type
+ QByteArray signature;
+ QDBusMetaType::MarshallFunction marshall;
+ QDBusMetaType::DemarshallFunction demarshall;
+};
+
struct QDBusMetaTypeId
{
static int message(); // QDBusMessage
@@ -67,7 +85,14 @@ struct QDBusMetaTypeId
static int error(); // QDBusError
static int unixfd(); // QDBusUnixFileDescriptor
- static void init();
+ static void init() { instance(); }
+ static QDBusMetaTypeId *instance();
+
+ mutable QReadWriteLock customTypesLock;
+ QVector<QDBusCustomTypeInfo> customTypes;
+
+protected:
+ QDBusMetaTypeId();
};
inline int QDBusMetaTypeId::message()
--
2.9.3

View File

@ -1,37 +0,0 @@
From 46f1c4c86bbfe7b6917907700bec998626ad4a8b Mon Sep 17 00:00:00 2001
From: Alexander Volkov <a.volkov@rusbitech.ru>
Date: Wed, 11 May 2016 18:42:24 +0300
Subject: [PATCH 001/178] xcb: Properly interpret data.l[0] field of XdndStatus
message
The standard https://freedesktop.org/wiki/Specifications/XDND/
states: "In order for the proxy window to behave correctly, the
appropriate field of the client messages, window or data.l[0],
must contain the ID of the window in which the mouse is located,
not the proxy window that is receiving the messages."
So compare it with the current target window instead of the
current proxy window.
Change-Id: Ie31fd3aeadebcf5a9be7b9a9194f35a4ec7bdebb
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
---
src/plugins/platforms/xcb/qxcbdrag.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp
index 6fa5dfa..f93e420 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.cpp
+++ b/src/plugins/platforms/xcb/qxcbdrag.cpp
@@ -829,7 +829,7 @@ void QXcbDrag::handle_xdnd_status(const xcb_client_message_event_t *event)
DEBUG("xdndHandleStatus");
waiting_for_status = false;
// ignore late status messages
- if (event->data.data32[0] && event->data.data32[0] != current_proxy_target)
+ if (event->data.data32[0] && event->data.data32[0] != current_target)
return;
const bool dropPossible = event->data.data32[1];
--
2.7.4

View File

@ -0,0 +1,121 @@
From d060b7aa5fc64902ea89416e58b57d6a90f5aea6 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Tue, 31 May 2016 17:33:03 -0300
Subject: [PATCH 2/2] Fix some QtDBus crashes during application destruction
It's possible that some code executes after QDBusConnectionManager is
destroyed and still tries to access QtDBus. Protect against such
crashes.
Change-Id: I87e17314d8b24ae983b1fffd1453c13fbd3cf48e
---
src/dbus/qdbusconnection.cpp | 12 ++++++++----
src/dbus/qdbusintegrator.cpp | 3 +++
src/dbus/qdbusserver.cpp | 12 ++++++++++--
3 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
index 4db6396..c1c4f05 100644
--- a/src/dbus/qdbusconnection.cpp
+++ b/src/dbus/qdbusconnection.cpp
@@ -429,7 +429,7 @@ void QDBusConnectionManager::createServer(const QString &address, void *server)
*/
QDBusConnection::QDBusConnection(const QString &name)
{
- if (name.isEmpty()) {
+ if (name.isEmpty() || _q_manager.isDestroyed()) {
d = 0;
} else {
QMutexLocker locker(&_q_manager()->mutex);
@@ -494,7 +494,7 @@ QDBusConnection &QDBusConnection::operator=(const QDBusConnection &other)
*/
QDBusConnection QDBusConnection::connectToBus(BusType type, const QString &name)
{
- if (!qdbus_loadLibDBus()) {
+ if (_q_manager.isDestroyed() || !qdbus_loadLibDBus()) {
QDBusConnectionPrivate *d = 0;
return QDBusConnection(d);
}
@@ -508,7 +508,7 @@ QDBusConnection QDBusConnection::connectToBus(BusType type, const QString &name)
QDBusConnection QDBusConnection::connectToBus(const QString &address,
const QString &name)
{
- if (!qdbus_loadLibDBus()) {
+ if (_q_manager.isDestroyed() || !qdbus_loadLibDBus()) {
QDBusConnectionPrivate *d = 0;
return QDBusConnection(d);
}
@@ -523,7 +523,7 @@ QDBusConnection QDBusConnection::connectToBus(const QString &address,
QDBusConnection QDBusConnection::connectToPeer(const QString &address,
const QString &name)
{
- if (!qdbus_loadLibDBus()) {
+ if (_q_manager.isDestroyed() || !qdbus_loadLibDBus()) {
QDBusConnectionPrivate *d = 0;
return QDBusConnection(d);
}
@@ -1178,6 +1178,8 @@ bool QDBusConnection::unregisterService(const QString &serviceName)
*/
QDBusConnection QDBusConnection::sessionBus()
{
+ if (_q_manager.isDestroyed())
+ return QDBusConnection(Q_NULLPTR);
return QDBusConnection(_q_manager()->busConnection(SessionBus));
}
@@ -1190,6 +1192,8 @@ QDBusConnection QDBusConnection::sessionBus()
*/
QDBusConnection QDBusConnection::systemBus()
{
+ if (_q_manager.isDestroyed())
+ return QDBusConnection(Q_NULLPTR);
return QDBusConnection(_q_manager()->busConnection(SystemBus));
}
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 37d2ae1..9ea30d1 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -293,6 +293,9 @@ static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, v
Q_ASSERT(connection);
Q_ASSERT(data);
+ if (!QDBusConnectionManager::instance())
+ return;
+
// keep the connection alive
q_dbus_connection_ref(connection);
QDBusConnectionPrivate *serverConnection = static_cast<QDBusConnectionPrivate *>(data);
diff --git a/src/dbus/qdbusserver.cpp b/src/dbus/qdbusserver.cpp
index babb270..ecb7d4f 100644
--- a/src/dbus/qdbusserver.cpp
+++ b/src/dbus/qdbusserver.cpp
@@ -62,7 +62,11 @@ QDBusServer::QDBusServer(const QString &address, QObject *parent)
if (!qdbus_loadLibDBus())
return;
- emit QDBusConnectionManager::instance()->serverRequested(address, this);
+ QDBusConnectionManager *instance = QDBusConnectionManager::instance();
+ if (!instance)
+ return;
+
+ emit instance->serverRequested(address, this);
QObject::connect(d, SIGNAL(newServerConnection(QDBusConnectionPrivate*)),
this, SLOT(_q_newConnection(QDBusConnectionPrivate*)), Qt::QueuedConnection);
}
@@ -87,7 +91,11 @@ QDBusServer::QDBusServer(QObject *parent)
return;
}
- emit QDBusConnectionManager::instance()->serverRequested(address, this);
+ QDBusConnectionManager *instance = QDBusConnectionManager::instance();
+ if (!instance)
+ return;
+
+ emit instance->serverRequested(address, this);
QObject::connect(d, SIGNAL(newServerConnection(QDBusConnectionPrivate*)),
this, SLOT(_q_newConnection(QDBusConnectionPrivate*)), Qt::QueuedConnection);
}
--
2.9.3

View File

@ -1,31 +0,0 @@
From 2852a8b87e3a8ed95b72d26b0e180b7fd4491cf3 Mon Sep 17 00:00:00 2001
From: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Date: Fri, 26 Feb 2016 11:53:01 -0800
Subject: [PATCH 011/178] XCB: Auto-detect xcb-glx also with xcb-qt
Task-number: QTBUG-43784
Change-Id: Iaa0388e34900f6241db8cd864caed4fb6fc32819
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
---
configure | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/configure b/configure
index ce5b9c2..a481981 100755
--- a/configure
+++ b/configure
@@ -5555,6 +5555,11 @@ if [ "$CFG_XCB" != "no" ]; then
if [ "$CFG_XCB" = "qt" ]; then
QT_CONFIG="$QT_CONFIG xcb-qt"
+
+ if compileTest qpa/xcb-glx "xcb-glx" $QMAKE_CFLAGS_XCB $QMAKE_LIBS_XCB; then
+ CFG_XCB_GLX=yes
+ QT_CONFIG="$QT_CONFIG xcb-glx"
+ fi
else
CFG_XCB="system"
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xcb >= 1.5" 2>/dev/null; then
--
2.7.4

View File

@ -0,0 +1,43 @@
From 2cf3dee10be1d2163eff0893f51f9ece643c2540 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= <spaz16@wp.pl>
Date: Mon, 12 Sep 2016 15:22:20 +0200
Subject: [PATCH 019/352] xcb: Don't send "Qt::WindowNoState" event when hiding
minimized window
This prevents getting "QWidget::showEvent()" when hiding minimized
widget on some WMs like Marco or Xfwm4.
If QWindow is minimized and it gets the new "XCB_WM_STATE_WITHDRAWN"
event from XCB, then don't change the QWindow state.
Task-number: QTBUG-55942
Change-Id: I90cfc2bf55e507864ad8f26c8f569ea562c27314
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
---
src/plugins/platforms/xcb/qxcbwindow.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index da50201..d46228c 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -2543,8 +2543,13 @@ void QXcbWindow::handlePropertyNotifyEvent(const xcb_property_notify_event_t *ev
if (reply && reply->format == 32 && reply->type == atom(QXcbAtom::WM_STATE)) {
const quint32 *data = (const quint32 *)xcb_get_property_value(reply);
- if (reply->length != 0 && XCB_WM_STATE_ICONIC == data[0])
- newState = Qt::WindowMinimized;
+ if (reply->length != 0) {
+ if (data[0] == XCB_WM_STATE_ICONIC
+ || (data[0] == XCB_WM_STATE_WITHDRAWN
+ && m_lastWindowStateEvent == Qt::WindowMinimized)) {
+ newState = Qt::WindowMinimized;
+ }
+ }
}
free(reply);
} else { // _NET_WM_STATE can't change minimized state
--
2.9.3

View File

@ -0,0 +1,36 @@
From 2c48695f04b0f4b3b11ec037b13132b146cad082 Mon Sep 17 00:00:00 2001
From: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Date: Thu, 15 Sep 2016 23:21:15 +0200
Subject: [PATCH 032/352] XCB Drop from external app: fix keyboard modifier
state
Fix inspired by Qt 4 sources. When we get drop events that are not
coming from the same application, it's unlikely that the keyboard
modifiers are in a sensible state (the usual XCB events are not sent
during drag and drop), so set the keyboard modifier state explicitly.
Task-number: QTBUG-49645
Change-Id: I9360f2b7ffeaa5243a4dfe7ccf96df134c5d2156
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
---
src/plugins/platforms/xcb/qxcbdrag.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp
index f93e420..acfb580 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.cpp
+++ b/src/plugins/platforms/xcb/qxcbdrag.cpp
@@ -960,6 +960,9 @@ void QXcbDrag::handleDrop(QPlatformWindow *, const xcb_client_message_event_t *e
} else {
dropData = platformDropData();
supported_drop_actions = accepted_drop_action;
+
+ // Drop coming from another app? Update keyboard modifiers.
+ QGuiApplicationPrivate::modifier_buttons = QGuiApplication::queryKeyboardModifiers();
}
if (!dropData)
--
2.9.3

View File

@ -1,78 +0,0 @@
From 1108291e1a2e7de23440c2b36b2fd31010ae3f51 Mon Sep 17 00:00:00 2001
From: Urs Fleisch <ufleisch@users.sourceforge.net>
Date: Tue, 3 May 2016 20:01:01 +0200
Subject: [PATCH 032/178] xcb: Fix drop of text/uri-list and text/html.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When dropping URLs from Firefox or Chrome, the contents are encoded as
UTF16, but not correctly decoded. Moreover, the special handling of
"text/x-moz-url" drops does not work because this format is converted to
"text/uri-list" before. This fixes the handling for URL list and also
for UTF16 "text/html".
Task-number: QTBUG-47981
Change-Id: I1153f21ede07b2bfe4d104e0fe8bc8487ec5c165
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
---
src/plugins/platforms/xcb/qxcbmime.cpp | 42 +++++++++++++++++++++++++---------
1 file changed, 31 insertions(+), 11 deletions(-)
diff --git a/src/plugins/platforms/xcb/qxcbmime.cpp b/src/plugins/platforms/xcb/qxcbmime.cpp
index eeac561..cef2210 100644
--- a/src/plugins/platforms/xcb/qxcbmime.cpp
+++ b/src/plugins/platforms/xcb/qxcbmime.cpp
@@ -182,17 +182,37 @@ QVariant QXcbMime::mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a,
a == connection->atom(QXcbAtom::TEXT))
return QString::fromLatin1(data);
}
-
- // special case for uri types
- if (format == QLatin1String("text/uri-list")) {
- if (atomName == QLatin1String("text/x-moz-url")) {
- // we expect this as utf16 <url><space><title>
- // the first part is a url that should only contain ascci char
- // so it should be safe to check that the second char is 0
- // to verify that it is utf16
- if (data.size() > 1 && data.at(1) == 0)
- return QString::fromRawData((const QChar *)data.constData(),
- data.size() / 2).split(QLatin1Char('\n')).first().toLatin1();
+ // If data contains UTF16 text, convert it to a string.
+ // Firefox uses UTF16 without BOM for text/x-moz-url, "text/html",
+ // Google Chrome uses UTF16 without BOM for "text/x-moz-url",
+ // UTF16 with BOM for "text/html".
+ if ((format == QLatin1String("text/html") || format == QLatin1String("text/uri-list"))
+ && data.size() > 1) {
+ const quint8 byte0 = data.at(0);
+ const quint8 byte1 = data.at(1);
+ if ((byte0 == 0xff && byte1 == 0xfe) || (byte0 == 0xfe && byte1 == 0xff)
+ || (byte0 != 0 && byte1 == 0) || (byte0 == 0 && byte1 != 0)) {
+ const QString str = QString::fromUtf16(
+ reinterpret_cast<const ushort *>(data.constData()), data.size() / 2);
+ if (!str.isNull()) {
+ if (format == QLatin1String("text/uri-list")) {
+ const QStringList urls = str.split(QLatin1Char('\n'));
+ QList<QVariant> list;
+ foreach (const QString &s, urls) {
+ const QUrl url(s.trimmed());
+ if (url.isValid())
+ list.append(url);
+ }
+ // We expect "text/x-moz-url" as <url><space><title>.
+ // The atomName variable is not used because mimeAtomToString()
+ // converts "text/x-moz-url" to "text/uri-list".
+ if (!list.isEmpty() && connection->atomName(a) == "text/x-moz-url")
+ return list.first();
+ return list;
+ } else {
+ return str;
+ }
+ }
}
}
--
2.7.4

View File

@ -1,58 +0,0 @@
From f162e29acca99aaab173fb323d112aad9ec6c2b5 Mon Sep 17 00:00:00 2001
From: Urs Fleisch <ufleisch@users.sourceforge.net>
Date: Wed, 4 May 2016 19:47:16 +0200
Subject: [PATCH 033/178] xcb: Fix dropping URL on Firefox window.
When a URL is dropped on a Firefox window, the "text/x-moz-url" data
takes precedence over the "text/uri-list". The "text/x-moz-url" is
interpreted as UTF16, however, the data from Qt 5 applications is not
in the correct format. The code to create correct UTF16 data exists,
but it is not called for two reasons: The atomName will never be
"text/x-moz-url" because it is changed to "text/uri-list" by
mimeAtomToString() and the InternalMimeData::hasFormatHelper() case is
already handled above and the else part will never be considered.
This patch fixes the check and brings it into the right order.
Task-number: QTBUG-49947
Change-Id: I5ebd31914cc6c1417c513c1ff09e0e858a16915d
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
---
src/plugins/platforms/xcb/qxcbmime.cpp | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/plugins/platforms/xcb/qxcbmime.cpp b/src/plugins/platforms/xcb/qxcbmime.cpp
index cef2210..7fea068 100644
--- a/src/plugins/platforms/xcb/qxcbmime.cpp
+++ b/src/plugins/platforms/xcb/qxcbmime.cpp
@@ -111,17 +111,18 @@ bool QXcbMime::mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeDa
QString atomName = mimeAtomToString(connection, a);
if (QInternalMimeData::hasFormatHelper(atomName, mimeData)) {
*data = QInternalMimeData::renderDataHelper(atomName, mimeData);
- if (atomName == QLatin1String("application/x-color"))
+ // mimeAtomToString() converts "text/x-moz-url" to "text/uri-list",
+ // so QXcbConnection::atomName() has to be used.
+ if (atomName == QLatin1String("text/uri-list")
+ && connection->atomName(a) == "text/x-moz-url") {
+ const QByteArray uri = data->split('\n').first();
+ QString mozUri = QString::fromLatin1(uri, uri.size());
+ mozUri += QLatin1Char('\n');
+ *data = QByteArray(reinterpret_cast<const char *>(mozUri.utf16()),
+ mozUri.length() * 2);
+ } else if (atomName == QLatin1String("application/x-color"))
*dataFormat = 16;
ret = true;
- } else if (atomName == QLatin1String("text/x-moz-url") &&
- QInternalMimeData::hasFormatHelper(QLatin1String("text/uri-list"), mimeData)) {
- QByteArray uri = QInternalMimeData::renderDataHelper(
- QLatin1String("text/uri-list"), mimeData).split('\n').first();
- QString mozUri = QString::fromLatin1(uri, uri.size());
- mozUri += QLatin1Char('\n');
- *data = QByteArray(reinterpret_cast<const char *>(mozUri.utf16()), mozUri.length() * 2);
- ret = true;
} else if ((a == XCB_ATOM_PIXMAP || a == XCB_ATOM_BITMAP) && mimeData->hasImage()) {
ret = true;
}
--
2.7.4

View File

@ -0,0 +1,150 @@
From 76adb6c29f9284a3d7cceb8fb09c3bb7c4cd5e1b Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Thu, 21 Apr 2016 01:39:27 +0200
Subject: [PATCH 036/352] xcb: Use the state of the key event to process it
Instead of the global state
Task-number: QTBUG-48795
Change-Id: Ic2c545718adb68df41730e5a3bf25adb374ffce3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
---
src/plugins/platforms/xcb/qxcbkeyboard.cpp | 72 ++++++++++++++++++------------
src/plugins/platforms/xcb/qxcbkeyboard.h | 2 +
2 files changed, 46 insertions(+), 28 deletions(-)
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
index 28de86b..e0fcc01 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -742,8 +742,7 @@ void QXcbKeyboard::updateKeymap()
// update xkb state object
xkb_state_unref(xkb_state);
xkb_state = new_state;
- if (!connection()->hasXKB())
- updateXKBMods();
+ updateXKBMods();
checkForLatinLayout();
}
@@ -768,32 +767,37 @@ void QXcbKeyboard::updateXKBState(xcb_xkb_state_notify_event_t *state)
}
#endif
+void QXcbKeyboard::updateXKBStateFromState(struct xkb_state *kb_state, quint16 state)
+{
+ const quint32 modsDepressed = xkb_state_serialize_mods(kb_state, XKB_STATE_MODS_DEPRESSED);
+ const quint32 modsLatched = xkb_state_serialize_mods(kb_state, XKB_STATE_MODS_LATCHED);
+ const quint32 modsLocked = xkb_state_serialize_mods(kb_state, XKB_STATE_MODS_LOCKED);
+ const quint32 xkbMask = xkbModMask(state);
+
+ const quint32 latched = modsLatched & xkbMask;
+ const quint32 locked = modsLocked & xkbMask;
+ quint32 depressed = modsDepressed & xkbMask;
+ // set modifiers in depressed if they don't appear in any of the final masks
+ depressed |= ~(depressed | latched | locked) & xkbMask;
+
+ const xkb_state_component newState
+ = xkb_state_update_mask(kb_state,
+ depressed,
+ latched,
+ locked,
+ 0,
+ 0,
+ (state >> 13) & 3); // bits 13 and 14 report the state keyboard group
+
+ if ((newState & XKB_STATE_LAYOUT_EFFECTIVE) == XKB_STATE_LAYOUT_EFFECTIVE) {
+ //qWarning("TODO: Support KeyboardLayoutChange on QPA (QTBUG-27681)");
+ }
+}
+
void QXcbKeyboard::updateXKBStateFromCore(quint16 state)
{
if (m_config && !connection()->hasXKB()) {
- const quint32 modsDepressed = xkb_state_serialize_mods(xkb_state, XKB_STATE_MODS_DEPRESSED);
- const quint32 modsLatched = xkb_state_serialize_mods(xkb_state, XKB_STATE_MODS_LATCHED);
- const quint32 modsLocked = xkb_state_serialize_mods(xkb_state, XKB_STATE_MODS_LOCKED);
- const quint32 xkbMask = xkbModMask(state);
-
- const quint32 latched = modsLatched & xkbMask;
- const quint32 locked = modsLocked & xkbMask;
- quint32 depressed = modsDepressed & xkbMask;
- // set modifiers in depressed if they don't appear in any of the final masks
- depressed |= ~(depressed | latched | locked) & xkbMask;
-
- const xkb_state_component newState
- = xkb_state_update_mask(xkb_state,
- depressed,
- latched,
- locked,
- 0,
- 0,
- (state >> 13) & 3); // bits 13 and 14 report the state keyboard group
-
- if ((newState & XKB_STATE_LAYOUT_EFFECTIVE) == XKB_STATE_LAYOUT_EFFECTIVE) {
- //qWarning("TODO: Support KeyboardLayoutChange on QPA (QTBUG-27681)");
- }
+ updateXKBStateFromState(xkb_state, state);
}
}
@@ -1455,7 +1459,16 @@ void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type,
if (type == QEvent::KeyPress)
targetWindow->updateNetWmUserTime(time);
- xcb_keysym_t sym = xkb_state_key_get_one_sym(xkb_state, code);
+ // Have a temporary keyboard state filled in from state
+ // this way we allow for synthetic events to have different state
+ // from the current state i.e. you can have Alt+Ctrl pressed
+ // and receive a synthetic key event that has neither Alt nor Ctrl pressed
+ struct xkb_state *kb_state = xkb_state_new(xkb_keymap);
+ if (!kb_state)
+ return;
+ updateXKBStateFromState(kb_state, state);
+
+ xcb_keysym_t sym = xkb_state_key_get_one_sym(kb_state, code);
QPlatformInputContext *inputContext = QGuiApplicationPrivate::platformIntegration()->inputContext();
QMetaMethod method;
@@ -1474,11 +1487,13 @@ void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type,
Q_ARG(uint, code),
Q_ARG(uint, state),
Q_ARG(bool, type == QEvent::KeyPress));
- if (retval)
+ if (retval) {
+ xkb_state_unref(kb_state);
return;
+ }
}
- QString string = lookupString(xkb_state, code);
+ QString string = lookupString(kb_state, code);
// Ιf control modifier is set we should prefer latin character, this is
// used for standard shortcuts in checks like "key == QKeySequence::Copy",
@@ -1547,6 +1562,7 @@ void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type,
QWindowSystemInterface::handleExtendedKeyEvent(window, time, QEvent::KeyPress, qtcode, modifiers,
code, sym, state, string, isAutoRepeat);
}
+ xkb_state_unref(kb_state);
}
QString QXcbKeyboard::lookupString(struct xkb_state *state, xcb_keycode_t code) const
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.h b/src/plugins/platforms/xcb/qxcbkeyboard.h
index 457a27a..dc27511 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.h
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.h
@@ -98,6 +98,8 @@ protected:
void checkForLatinLayout();
private:
+ void updateXKBStateFromState(struct xkb_state *kb_state, quint16 state);
+
bool m_config;
xcb_keycode_t m_autorepeat_code;
--
2.9.3

View File

@ -0,0 +1,139 @@
From 422838685c31d9b57133a8711bfd5db92095d96d Mon Sep 17 00:00:00 2001
From: Robin Burchell <robin.burchell@viroteck.net>
Date: Wed, 7 Sep 2016 14:34:03 +0200
Subject: [PATCH 084/352] xcb: Treat bitmap cursors differently from shaped
cursors
QXcbCursor had a "cache" of cursor handles. Unfortunately, as QXcbCursor has its
lifetime tied to the screen, this cache grew unbounded whenever the cursor was
set: this could be witnessed worst when repeatedly setting the current cursor to
a different pixmap each time.
We fix this by keeping the cursor cache only for the "regular" shaped cursors
that are often shared between windows, working on the assumption that custom
cursors are generally specific only to a given window. This makes the lifetime
of the bitmap cursors much more clear: they are tied to that window, and when
the window is destroyed (or changes cursor), so too is the bitmap cursor
destroyed (if set).
Reported-by: Will Thompson <wjt@endlessm.com>
Change-Id: Ia558d858ff49e89cd5220344567203eb0267a133
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
---
src/plugins/platforms/xcb/qxcbcursor.cpp | 24 +++++++++++++++++-------
src/plugins/platforms/xcb/qxcbwindow.cpp | 22 +++++++++++++++++++---
src/plugins/platforms/xcb/qxcbwindow.h | 3 ++-
3 files changed, 38 insertions(+), 11 deletions(-)
diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
index b321ed9..4646ced 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -353,17 +353,27 @@ void QXcbCursor::changeCursor(QCursor *cursor, QWindow *widget)
return;
xcb_cursor_t c = XCB_CURSOR_NONE;
+ bool isBitmapCursor = false;
+
if (cursor) {
- const QXcbCursorCacheKey key(*cursor);
- CursorHash::iterator it = m_cursorHash.find(key);
- if (it == m_cursorHash.end()) {
- const Qt::CursorShape shape = cursor->shape();
- it = m_cursorHash.insert(key, shape == Qt::BitmapCursor ? createBitmapCursor(cursor) : createFontCursor(shape));
+ const Qt::CursorShape shape = cursor->shape();
+ isBitmapCursor = shape == Qt::BitmapCursor;
+
+ if (!isBitmapCursor) {
+ const QXcbCursorCacheKey key(*cursor);
+ CursorHash::iterator it = m_cursorHash.find(key);
+ if (it == m_cursorHash.end()) {
+ it = m_cursorHash.insert(key, createFontCursor(shape));
+ }
+ c = it.value();
+ } else {
+ // Do not cache bitmap cursors, as otherwise they have unclear
+ // lifetime (we effectively leak xcb_cursor_t).
+ c = createBitmapCursor(cursor);
}
- c = it.value();
}
- w->setCursor(c);
+ w->setCursor(c, isBitmapCursor);
}
static int cursorIdForShape(int cshape)
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index d46228c..5f402b6 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -302,6 +302,7 @@ QXcbWindow::QXcbWindow(QWindow *window)
, m_lastWindowStateEvent(-1)
, m_syncState(NoSyncNeeded)
, m_pendingSyncRequest(0)
+ , m_currentBitmapCursor(XCB_CURSOR_NONE)
{
setConnection(xcbScreen()->connection());
}
@@ -620,6 +621,9 @@ void QXcbWindow::create()
QXcbWindow::~QXcbWindow()
{
+ if (m_currentBitmapCursor != XCB_CURSOR_NONE) {
+ xcb_free_cursor(xcb_connection(), m_currentBitmapCursor);
+ }
if (window()->type() != Qt::ForeignWindow)
destroy();
else {
@@ -2665,10 +2669,22 @@ bool QXcbWindow::setMouseGrabEnabled(bool grab)
return result;
}
-void QXcbWindow::setCursor(xcb_cursor_t cursor)
+void QXcbWindow::setCursor(xcb_cursor_t cursor, bool isBitmapCursor)
{
- xcb_change_window_attributes(xcb_connection(), m_window, XCB_CW_CURSOR, &cursor);
- xcb_flush(xcb_connection());
+ xcb_connection_t *conn = xcb_connection();
+
+ xcb_change_window_attributes(conn, m_window, XCB_CW_CURSOR, &cursor);
+ xcb_flush(conn);
+
+ if (m_currentBitmapCursor != XCB_CURSOR_NONE) {
+ xcb_free_cursor(conn, m_currentBitmapCursor);
+ }
+
+ if (isBitmapCursor) {
+ m_currentBitmapCursor = cursor;
+ } else {
+ m_currentBitmapCursor = XCB_CURSOR_NONE;
+ }
}
void QXcbWindow::windowEvent(QEvent *event)
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index b8bcf44..f2b6904 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -97,7 +97,7 @@ public:
bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE;
bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE;
- void setCursor(xcb_cursor_t cursor);
+ void setCursor(xcb_cursor_t cursor, bool isBitmapCursor);
QSurfaceFormat format() const Q_DECL_OVERRIDE;
@@ -263,6 +263,7 @@ protected:
SyncState m_syncState;
QXcbSyncWindowRequest *m_pendingSyncRequest;
+ xcb_cursor_t m_currentBitmapCursor;
};
QT_END_NAMESPACE
--
2.9.3

View File

@ -0,0 +1,85 @@
From f43c9697bcae997be3eb6db9504f3d7b64601148 Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@kdab.com>
Date: Tue, 27 Sep 2016 14:55:09 +0200
Subject: [PATCH 098/352] Plug QMimeData leaks in QXcbClipboard
QXcbClipboard failed to delete the various QMimeData instances
it owns.
For m_xClipboard, where the two QXcbClipboardMime instances are
never the same, fix the leak by using a scoped instead of a
naked pointer.
For m_clientClipboard, where the two QMimeData could be identical
objects, keep the naked pointers, but delete the objects manually
in the QXcbClipboard destructor, paying attention to the case
where they're the same object.
Change-Id: I5ce0e3e8fcec068aeb344ca806cdf2667378e946
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
---
src/plugins/platforms/xcb/qxcbclipboard.cpp | 12 +++++++-----
src/plugins/platforms/xcb/qxcbclipboard.h | 2 +-
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/plugins/platforms/xcb/qxcbclipboard.cpp b/src/plugins/platforms/xcb/qxcbclipboard.cpp
index 8b75c13..d44ebae 100644
--- a/src/plugins/platforms/xcb/qxcbclipboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbclipboard.cpp
@@ -269,8 +269,6 @@ QXcbClipboard::QXcbClipboard(QXcbConnection *c)
{
Q_ASSERT(QClipboard::Clipboard == 0);
Q_ASSERT(QClipboard::Selection == 1);
- m_xClipboard[QClipboard::Clipboard] = 0;
- m_xClipboard[QClipboard::Selection] = 0;
m_clientClipboard[QClipboard::Clipboard] = 0;
m_clientClipboard[QClipboard::Selection] = 0;
m_timestamp[QClipboard::Clipboard] = XCB_CURRENT_TIME;
@@ -323,6 +321,10 @@ QXcbClipboard::~QXcbClipboard()
}
free(reply);
}
+
+ if (m_clientClipboard[QClipboard::Clipboard] != m_clientClipboard[QClipboard::Selection])
+ delete m_clientClipboard[QClipboard::Clipboard];
+ delete m_clientClipboard[QClipboard::Selection];
}
void QXcbClipboard::incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted)
@@ -372,9 +374,9 @@ QMimeData * QXcbClipboard::mimeData(QClipboard::Mode mode)
return m_clientClipboard[mode];
} else {
if (!m_xClipboard[mode])
- m_xClipboard[mode] = new QXcbClipboardMime(mode, this);
+ m_xClipboard[mode].reset(new QXcbClipboardMime(mode, this));
- return m_xClipboard[mode];
+ return m_xClipboard[mode].data();
}
}
@@ -724,7 +726,7 @@ void QXcbClipboard::handleXFixesSelectionRequest(xcb_xfixes_selection_notify_eve
// here we care only about the xfixes events that come from non Qt processes
if (event->owner != XCB_NONE && event->owner != owner()) {
if (!m_xClipboard[mode]) {
- m_xClipboard[mode] = new QXcbClipboardMime(mode, this);
+ m_xClipboard[mode].reset(new QXcbClipboardMime(mode, this));
} else {
m_xClipboard[mode]->reset();
}
diff --git a/src/plugins/platforms/xcb/qxcbclipboard.h b/src/plugins/platforms/xcb/qxcbclipboard.h
index 10f0704..f9a34f4 100644
--- a/src/plugins/platforms/xcb/qxcbclipboard.h
+++ b/src/plugins/platforms/xcb/qxcbclipboard.h
@@ -92,7 +92,7 @@ private:
QClipboard::Mode modeForAtom(xcb_atom_t atom) const;
// Selection and Clipboard
- QXcbClipboardMime *m_xClipboard[2];
+ QScopedPointer<QXcbClipboardMime> m_xClipboard[2];
QMimeData *m_clientClipboard[2];
xcb_timestamp_t m_timestamp[2];
--
2.9.3

View File

@ -0,0 +1,64 @@
From f4fff02cbb1f9399f407c15a27741c6cd1a17133 Mon Sep 17 00:00:00 2001
From: Edward Welbourne <edward.welbourne@qt.io>
Date: Mon, 10 Oct 2016 16:09:32 +0200
Subject: [PATCH 145/352] QXcbShmImage: don't use shmget()'s return unless it
succeeds
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When shmget() failed, we didn't set m_shm_info.shmid (not even to the
-1 failure id) but did pass it (i.e. uninitialized noise) to shmat(),
among other related functions. Guard against this; handle failure
gracefully.
Task-number: QTBUG-56419
Change-Id: Ie823c36c2ede03af6cb5d94ce7b4b5cd543c1008
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Joni Poikelin <joni.poikelin@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
---
src/plugins/platforms/xcb/qxcbbackingstore.cpp | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index 3b04c59..0b76830 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -150,12 +150,13 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
return;
int id = shmget(IPC_PRIVATE, segmentSize, IPC_CREAT | 0600);
- if (id == -1)
+ if (id == -1) {
qWarning("QXcbShmImage: shmget() failed (%d: %s) for size %d (%dx%d)",
errno, strerror(errno), segmentSize, size.width(), size.height());
- else
- m_shm_info.shmid = id;
- m_shm_info.shmaddr = m_xcb_image->data = (quint8 *)shmat (m_shm_info.shmid, 0, 0);
+ } else {
+ m_shm_info.shmaddr = m_xcb_image->data = (quint8 *)shmat(id, 0, 0);
+ }
+ m_shm_info.shmid = id;
m_shm_info.shmseg = xcb_generate_id(xcb_connection());
const xcb_query_extension_reply_t *shm_reply = xcb_get_extension_data(xcb_connection(), &xcb_shm_id);
@@ -166,9 +167,10 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
if (!shm_present || error || id == -1) {
free(error);
- shmdt(m_shm_info.shmaddr);
- shmctl(m_shm_info.shmid, IPC_RMID, 0);
-
+ if (id != -1) {
+ shmdt(m_shm_info.shmaddr);
+ shmctl(m_shm_info.shmid, IPC_RMID, 0);
+ }
m_shm_info.shmaddr = 0;
m_xcb_image->data = (uint8_t *)malloc(segmentSize);
--
2.9.3

View File

@ -1,37 +0,0 @@
From 76810e1495b65a09e9abd6164639e0caf34d61b8 Mon Sep 17 00:00:00 2001
From: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Date: Fri, 20 May 2016 14:52:18 +0200
Subject: [PATCH 148/178] xcb: Disable GLX pbuffers with Chromium in VMs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Change-Id: I474e4a4ce424a92b46381eb26aeda811ed059819
Task-number: QTCREATORBUG-16252
Task-number: QTCREATORBUG-14937
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
---
.../platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp
index a3a8aa2..55d0ff3 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp
@@ -201,8 +201,10 @@ QPlatformOffscreenSurface *QXcbGlxIntegration::createPlatformOffscreenSurface(QO
display = static_cast<Display *>(m_connection->xlib_display());
#endif
const char *glxvendor = glXGetClientString(display, GLX_VENDOR);
- if (glxvendor && !strcmp(glxvendor, "ATI"))
- glxPbufferUsable = false;
+ if (glxvendor) {
+ if (!strcmp(glxvendor, "ATI") || !strcmp(glxvendor, "Chromium"))
+ glxPbufferUsable = false;
+ }
}
if (glxPbufferUsable)
return new QGLXPbuffer(surface);
--
2.7.4

View File

@ -1,64 +0,0 @@
From 4762fabce16c611f12542a48b0dd31b3cec8e530 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= <spaz16@wp.pl>
Date: Thu, 14 Apr 2016 13:20:23 +0200
Subject: [PATCH 155/178] xcb: Fix transient parent and "Qt::Window" flag
Don't set transient parent property when Qt::Window flag is set.
Delete transient parent property if a window doesn't have a transient parent.
Force setting standard window flags for Qt::Window only if there are no other
flags.
Amends 98c10a02c5b77e023471ad6993dc66b013889cfb
Task-number: QTBUG-52550
Change-Id: I68ee715b632487e9dd0e7ffbbfc0c2cdd0f0e151
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
---
src/plugins/platforms/xcb/qxcbwindow.cpp | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 429ba8d..0c2f0d7 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -821,9 +821,9 @@ void QXcbWindow::show()
propagateSizeHints();
// update WM_TRANSIENT_FOR
- const QWindow *tp = window()->transientParent();
- if (isTransient(window()) || tp != 0) {
- xcb_window_t transientXcbParent = 0;
+ xcb_window_t transientXcbParent = 0;
+ if (isTransient(window())) {
+ const QWindow *tp = window()->transientParent();
if (tp && tp->handle())
transientXcbParent = static_cast<const QXcbWindow *>(tp->handle())->winId();
// Default to client leader if there is no transient parent, else modal dialogs can
@@ -836,6 +836,8 @@ void QXcbWindow::show()
1, &transientXcbParent));
}
}
+ if (!transientXcbParent)
+ Q_XCB_CALL(xcb_delete_property(xcb_connection(), m_window, XCB_ATOM_WM_TRANSIENT_FOR));
// update _MOTIF_WM_HINTS
updateMotifWmHintsBeforeMap();
@@ -1195,9 +1197,11 @@ void QXcbWindow::setMotifWindowFlags(Qt::WindowFlags flags)
mwmhints.flags |= MWM_HINTS_DECORATIONS;
bool customize = flags & Qt::CustomizeWindowHint;
- if (type == Qt::Window && !customize)
- flags |= Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint;
-
+ if (type == Qt::Window && !customize) {
+ const Qt::WindowFlags defaultFlags = Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint;
+ if (!(flags & defaultFlags))
+ flags |= defaultFlags;
+ }
if (!(flags & Qt::FramelessWindowHint) && !(customize && !(flags & Qt::WindowTitleHint))) {
mwmhints.decorations |= MWM_DECOR_BORDER;
mwmhints.decorations |= MWM_DECOR_RESIZEH;
--
2.7.4

View File

@ -0,0 +1,85 @@
From ee22c6505a1f7cf52a862b1bd9219511db893417 Mon Sep 17 00:00:00 2001
From: Clinton Stimpson <clinton@elemtech.com>
Date: Tue, 30 Aug 2016 07:52:17 -0600
Subject: [PATCH 177/352] xcb: fix passing of focus from child to its top level
QWindow
With the client message _NET_ACTIVE_WINDOW, not all window managers
will pass focus from a child window to its root window, Detect this
child-to-root case, and use xcb_set_input_focus() instead.
Task-number: QTBUG-39362
Change-Id: Ib32193018e3b725b323f87d7306c9ae9493d78a7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
---
src/plugins/platforms/xcb/qxcbwindow.cpp | 3 ++-
tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 20 +++++++++++++++++++-
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 5f402b6..25a8b41 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -1698,9 +1698,11 @@ void QXcbWindow::requestActivateWindow()
m_deferredActivation = false;
updateNetWmUserTime(connection()->time());
+ QWindow *focusWindow = QGuiApplication::focusWindow();
if (window()->isTopLevel()
&& !(window()->flags() & Qt::X11BypassWindowManagerHint)
+ && (!focusWindow || !window()->isAncestorOf(focusWindow))
&& connection()->wmSupport()->isSupportedByWM(atom(QXcbAtom::_NET_ACTIVE_WINDOW))) {
xcb_client_message_event_t event;
@@ -1711,7 +1713,6 @@ void QXcbWindow::requestActivateWindow()
event.type = atom(QXcbAtom::_NET_ACTIVE_WINDOW);
event.data.data32[0] = 1;
event.data.data32[1] = connection()->time();
- QWindow *focusWindow = QGuiApplication::focusWindow();
event.data.data32[2] = focusWindow ? focusWindow->winId() : XCB_NONE;
event.data.data32[3] = 0;
event.data.data32[4] = 0;
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 0cce5a0..d904d48 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -601,6 +601,24 @@ void tst_QWindow::isActive()
// child has focus
QVERIFY(window.isActive());
+ // test focus back to parent and then back to child (QTBUG-39362)
+ // also verify the cumulative FocusOut and FocusIn counts
+ // activate parent
+ window.requestActivate();
+ QTRY_COMPARE(QGuiApplication::focusWindow(), &window);
+ QVERIFY(window.isActive());
+ QCoreApplication::processEvents();
+ QTRY_COMPARE(child.received(QEvent::FocusOut), 1);
+ QTRY_COMPARE(window.received(QEvent::FocusIn), 2);
+
+ // activate child again
+ child.requestActivate();
+ QTRY_COMPARE(QGuiApplication::focusWindow(), &child);
+ QVERIFY(child.isActive());
+ QCoreApplication::processEvents();
+ QTRY_COMPARE(window.received(QEvent::FocusOut), 2);
+ QTRY_COMPARE(child.received(QEvent::FocusIn), 2);
+
Window dialog;
dialog.setTransientParent(&window);
dialog.setGeometry(QRect(m_availableTopLeft + QPoint(110, 100), m_testWindowSize));
@@ -625,7 +643,7 @@ void tst_QWindow::isActive()
QTRY_COMPARE(QGuiApplication::focusWindow(), &window);
QCoreApplication::processEvents();
QTRY_COMPARE(dialog.received(QEvent::FocusOut), 1);
- QTRY_COMPARE(window.received(QEvent::FocusIn), 2);
+ QTRY_COMPARE(window.received(QEvent::FocusIn), 3);
QVERIFY(window.isActive());
--
2.9.3

View File

@ -0,0 +1,38 @@
From 10b9321c1dc19236620ba20bdf54cae73891d1ef Mon Sep 17 00:00:00 2001
From: Anton Kudryavtsev <a.kudryavtsev@netris.ru>
Date: Wed, 19 Oct 2016 15:30:58 +0300
Subject: [PATCH 190/352] qxcbconnection.cpp: fix warning about unused function
isXIEvent() is used iff XCB_USE_XINPUT2 is defined.
So move declaration of the function in XCB_USE_XINPUT2 define scope.
Change-Id: I6f045cd07d572ee7425ee6edc5ac73dcf0afdb37
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
---
src/plugins/platforms/xcb/qxcbconnection.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index c533a2a..3d808d1 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -110,6 +110,7 @@ Q_LOGGING_CATEGORY(lcQpaScreen, "qt.qpa.screen")
#define XCB_GE_GENERIC 35
#endif
+#if defined(XCB_USE_XINPUT2)
// Starting from the xcb version 1.9.3 struct xcb_ge_event_t has changed:
// - "pad0" became "extension"
// - "pad1" and "pad" became "pad0"
@@ -127,6 +128,7 @@ static inline bool isXIEvent(xcb_generic_event_t *event, int opCode)
qt_xcb_ge_event_t *e = (qt_xcb_ge_event_t *)event;
return e->extension == opCode;
}
+#endif // XCB_USE_XINPUT2
#ifdef XCB_USE_XLIB
static const char * const xcbConnectionErrors[] = {
--
2.9.3

View File

@ -0,0 +1,82 @@
From ca4d93d85ee446c5e30ec8e7814651e45cbf1218 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Thu, 12 Nov 2015 10:14:51 -0800
Subject: [PATCH 237/352] Stop unloading plugins in QPluginLoader and
QFactoryLoader
QPluginLoader hasn't unloaded in its destructor since Qt 5.0, but we
missed the equivalent code in QFactoryLoader (which bypasses
QPluginLoader). Besides, QPluginLoader::unload() was still doing
unloading, which it won't anymore.
Not unloading plugins is Qt's policy, as decided during the 5.0
development process and reaffirmed now in 5.6. This is due to static
data in plugins leaking out and remaining in use past the unloading of
the plugin, causing crashes.
This does not affect QLibrary and QLibrary::unload(). Those are meant
for non-Qt loadable modules, so unloading them may be safe.
Task-number: QTBUG-49061
Discussed-on: http://lists.qt-project.org/pipermail/development/2015-November/023681.html
Change-Id: I461e9fc7199748faa187ffff1416070f138df8db
(cherry picked from commit 494376f980e96339b6f1eff7c41336ca4d853065)
Discussed-again-on: http://lists.qt-project.org/pipermail/development/2016-October/027476.html
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
---
src/corelib/plugin/qfactoryloader.cpp | 6 ++++--
src/corelib/plugin/qpluginloader.cpp | 5 +++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index dcf1b1a..b6558f5 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -208,10 +208,12 @@ void QFactoryLoader::update()
++keyUsageCount;
}
}
- if (keyUsageCount || keys.isEmpty())
+ if (keyUsageCount || keys.isEmpty()) {
+ library->setLoadHints(QLibrary::PreventUnloadHint); // once loaded, don't unload
d->libraryList += library;
- else
+ } else {
library->release();
+ }
}
}
#else
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index 37f2368..0ea8280 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -148,6 +148,7 @@ QPluginLoader::QPluginLoader(const QString &fileName, QObject *parent)
: QObject(parent), d(0), did_load(false)
{
setFileName(fileName);
+ setLoadHints(QLibrary::PreventUnloadHint);
}
/*!
@@ -342,7 +343,7 @@ static QString locatePlugin(const QString& fileName)
void QPluginLoader::setFileName(const QString &fileName)
{
#if defined(QT_SHARED)
- QLibrary::LoadHints lh;
+ QLibrary::LoadHints lh = QLibrary::PreventUnloadHint;
if (d) {
lh = d->loadHints();
d->release();
@@ -391,7 +392,7 @@ Q_GLOBAL_STATIC(StaticPluginList, staticPluginList)
\brief Give the load() function some hints on how it should behave.
You can give hints on how the symbols in the plugin are
- resolved. By default, none of the hints are set.
+ resolved. By default since Qt 5.7, QLibrary::PreventUnloadHint is set.
See the documentation of QLibrary::loadHints for a complete
description of how this property works.
--
2.9.3

View File

@ -0,0 +1,36 @@
From 3c2cb87de2554b9c4f6e2080768fe9ede00aeab3 Mon Sep 17 00:00:00 2001
From: Laszlo Agocs <laszlo.agocs@qt.io>
Date: Mon, 7 Nov 2016 09:54:55 +0100
Subject: [PATCH 263/352] xcb: Warn and bail out when even the basic, dummy
context fails
Do not move on to glGet since the behavior is undefined.
Task-number: QTBUG-48986
Change-Id: Ifd279635ed1b8441f92697965d15ae3ecb59a7e3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
---
.../platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
index 9bdedcc..c2b7a56 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
@@ -672,8 +672,11 @@ void QGLXContext::queryDummyContext()
}
QOpenGLContext context;
- context.create();
- context.makeCurrent(surface.data());
+ if (!context.create() || !context.makeCurrent(surface.data())) {
+ qWarning("QGLXContext: Failed to create dummy context");
+ m_supportsThreading = false;
+ return;
+ }
m_supportsThreading = true;
--
2.9.3

View File

@ -0,0 +1,40 @@
From 291eba6f8099a0fec8fbd9cf8a1fb67e5c9f4f8d Mon Sep 17 00:00:00 2001
From: Palo Kisa <palo.kisa@gmail.com>
Date: Mon, 7 Nov 2016 18:27:17 +0100
Subject: [PATCH 276/352] QClipboard: Fix emitting changed() in XCB
In XCB environment the QClipboard::changed() was not delivered if the
QClipboard::clear() was issued by other Qt app/process.
If the QClipboard::clear() is used, then the owner in
xcb_xfixes_selection_notify_event_t is XCB_NONE, so we need make the
decission to handle this event by the selection_timestamp and our
m_timestamp[mode].
Task-number: QTBUG-56972
Change-Id: If4c486ac02223eac506465cac7ff1a07bd02a187
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
---
src/plugins/platforms/xcb/qxcbclipboard.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/plugins/platforms/xcb/qxcbclipboard.cpp b/src/plugins/platforms/xcb/qxcbclipboard.cpp
index d44ebae..40abef4 100644
--- a/src/plugins/platforms/xcb/qxcbclipboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbclipboard.cpp
@@ -723,8 +723,10 @@ void QXcbClipboard::handleXFixesSelectionRequest(xcb_xfixes_selection_notify_eve
if (mode > QClipboard::Selection)
return;
- // here we care only about the xfixes events that come from non Qt processes
- if (event->owner != XCB_NONE && event->owner != owner()) {
+ // Note1: Here we care only about the xfixes events that come from other processes.
+ // Note2: If the QClipboard::clear() is issued, event->owner is XCB_NONE,
+ // so we check selection_timestamp to not handle our own QClipboard::clear().
+ if (event->owner != owner() && event->selection_timestamp > m_timestamp[mode]) {
if (!m_xClipboard[mode]) {
m_xClipboard[mode].reset(new QXcbClipboardMime(mode, this));
} else {
--
2.9.3

View File

@ -0,0 +1,80 @@
From dd52fd0024600d3beffc82d6da02b4239a62d725 Mon Sep 17 00:00:00 2001
From: Jocelyn Turcotte <jturcotte@woboq.com>
Date: Tue, 17 Jan 2017 17:05:00 +0100
Subject: [PATCH 295/420] Ensure a pixel density of at least 1 for
Qt::AA_EnableHighDpiScaling
Very large 1080p TVs or any display which is running at an abnormally
low resolution can have a DPI lower than 48, which means that
qRound(dpi/96) will result in a 0 pixel density, causing critical
issues for applications using Qt::AA_EnableHighDpiScaling.
Make sure that we always have a pixel density of at least 1 to allow
applications not having to worry about such displays.
Task-number: QTBUG-56140
Change-Id: I1dafbf7794a99ae6f872984c0337d8ff0d1fc1c0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
---
src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp | 2 +-
src/plugins/platforms/windows/qwindowsscreen.cpp | 2 +-
src/plugins/platforms/winrt/qwinrtscreen.cpp | 2 +-
src/plugins/platforms/xcb/qxcbscreen.cpp | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp
index 3e1e93f..863a115 100644
--- a/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp
@@ -226,7 +226,7 @@ QDpi QEglFSDeviceIntegration::logicalDpi() const
qreal QEglFSDeviceIntegration::pixelDensity() const
{
- return qRound(logicalDpi().first / qreal(100));
+ return qMax(1, qRound(logicalDpi().first / qreal(100)));
}
Qt::ScreenOrientation QEglFSDeviceIntegration::nativeOrientation() const
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp
index 7a885b4..c70323c 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.cpp
+++ b/src/plugins/platforms/windows/qwindowsscreen.cpp
@@ -265,7 +265,7 @@ qreal QWindowsScreen::pixelDensity() const
// the pixel density since it is reflects the Windows UI scaling.
// High DPI auto scaling should be disabled when the user chooses
// small fonts on a High DPI monitor, resulting in lower logical DPI.
- return qRound(logicalDpi().first / 96);
+ return qMax(1, qRound(logicalDpi().first / 96));
}
/*!
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp
index f87ae9f..2a4b6c8 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.cpp
+++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp
@@ -647,7 +647,7 @@ QDpi QWinRTScreen::logicalDpi() const
qreal QWinRTScreen::pixelDensity() const
{
Q_D(const QWinRTScreen);
- return qRound(d->logicalDpi / 96);
+ return qMax(1, qRound(d->logicalDpi / 96));
}
qreal QWinRTScreen::scaleFactor() const
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index a967593..d8facdb 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -631,7 +631,7 @@ void QXcbScreen::updateGeometry(const QRect &geom, uint8_t rotation)
m_sizeMillimeters = sizeInMillimeters(xGeometry.size(), virtualDpi());
qreal dpi = xGeometry.width() / physicalSize().width() * qreal(25.4);
- m_pixelDensity = qRound(dpi/96);
+ m_pixelDensity = qMax(1, qRound(dpi/96));
m_geometry = QRect(xGeometry.topLeft(), xGeometry.size());
m_availableGeometry = xGeometry & m_virtualDesktop->workArea();
QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry);
--
2.9.3

View File

@ -13,6 +13,7 @@
%_qt5_libdir %{_libdir}
%_qt5_libexecdir %{_qt5_archdatadir}/libexec
%_qt5_plugindir %{_qt5_archdatadir}/plugins
%_qt5_qmldir %{_qt5_archdatadir}/qml
%_qt5_qmake %{_qt5_bindir}/qmake
%_qt5_settingsdir %{_sysconfdir}/xdg
%_qt5_sysconfdir %{_qt5_settingsdir}

View File

@ -0,0 +1,48 @@
diff -up qtbase-opensource-src-5.6.2/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp.0295 qtbase-opensource-src-5.6.2/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp
--- qtbase-opensource-src-5.6.2/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp.0295 2017-02-13 12:58:54.062341106 -0600
+++ qtbase-opensource-src-5.6.2/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp 2017-02-13 13:00:13.318163725 -0600
@@ -224,7 +224,7 @@ QDpi QEGLDeviceIntegration::logicalDpi()
qreal QEGLDeviceIntegration::pixelDensity() const
{
- return qRound(logicalDpi().first / qreal(100));
+ return qMax(1, qRound(logicalDpi().first / qreal(100)));
}
Qt::ScreenOrientation QEGLDeviceIntegration::nativeOrientation() const
diff -up qtbase-opensource-src-5.6.2/src/plugins/platforms/windows/qwindowsscreen.cpp.0295 qtbase-opensource-src-5.6.2/src/plugins/platforms/windows/qwindowsscreen.cpp
--- qtbase-opensource-src-5.6.2/src/plugins/platforms/windows/qwindowsscreen.cpp.0295 2016-09-16 00:49:42.000000000 -0500
+++ qtbase-opensource-src-5.6.2/src/plugins/platforms/windows/qwindowsscreen.cpp 2017-02-13 12:58:54.063341117 -0600
@@ -258,7 +258,7 @@ qreal QWindowsScreen::pixelDensity() con
// the pixel density since it is reflects the Windows UI scaling.
// High DPI auto scaling should be disabled when the user chooses
// small fonts on a High DPI monitor, resulting in lower logical DPI.
- return qRound(logicalDpi().first / 96);
+ return qMax(1, qRound(logicalDpi().first / 96));
}
/*!
diff -up qtbase-opensource-src-5.6.2/src/plugins/platforms/winrt/qwinrtscreen.cpp.0295 qtbase-opensource-src-5.6.2/src/plugins/platforms/winrt/qwinrtscreen.cpp
--- qtbase-opensource-src-5.6.2/src/plugins/platforms/winrt/qwinrtscreen.cpp.0295 2016-09-16 00:49:42.000000000 -0500
+++ qtbase-opensource-src-5.6.2/src/plugins/platforms/winrt/qwinrtscreen.cpp 2017-02-13 12:58:54.063341117 -0600
@@ -641,7 +641,7 @@ QDpi QWinRTScreen::logicalDpi() const
qreal QWinRTScreen::pixelDensity() const
{
Q_D(const QWinRTScreen);
- return qRound(d->logicalDpi / 96);
+ return qMax(1, qRound(d->logicalDpi / 96));
}
qreal QWinRTScreen::scaleFactor() const
diff -up qtbase-opensource-src-5.6.2/src/plugins/platforms/xcb/qxcbscreen.cpp.0295 qtbase-opensource-src-5.6.2/src/plugins/platforms/xcb/qxcbscreen.cpp
--- qtbase-opensource-src-5.6.2/src/plugins/platforms/xcb/qxcbscreen.cpp.0295 2016-09-16 00:49:42.000000000 -0500
+++ qtbase-opensource-src-5.6.2/src/plugins/platforms/xcb/qxcbscreen.cpp 2017-02-13 12:58:54.063341117 -0600
@@ -565,7 +565,7 @@ void QXcbScreen::updateGeometry(const QR
m_sizeMillimeters = sizeInMillimeters(xGeometry.size(), virtualDpi());
qreal dpi = xGeometry.width() / physicalSize().width() * qreal(25.4);
- m_pixelDensity = qRound(dpi/96);
+ m_pixelDensity = qMax(1, qRound(dpi/96));
m_geometry = QRect(xGeometry.topLeft(), xGeometry.size());
m_availableGeometry = xGeometry & m_virtualDesktop->workArea();
QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry);

View File

@ -52,12 +52,10 @@ BuildRequires: pkgconfig(libsystemd)
%global tests 1
%endif
#define prerelease rc
Summary: Qt5 - QtBase components
Name: qt5-qtbase
Version: 5.6.1
Release: 3%{?prerelease:.%{prerelease}}%{?dist}
Version: 5.6.2
Release: 4%{?dist}
# See LGPL_EXCEPTIONS.txt, for exception details
License: LGPLv2 with exceptions or GPLv3 with exceptions
@ -79,35 +77,50 @@ Source6: 10-qt5-check-opengl2.sh
Patch2: qtbase-multilib_optflags.patch
# fix QTBUG-35459 (too low entityCharacterLimit=1024 for CVE-2013-4549)
Patch4: qtbase-opensource-src-5.3.2-QTBUG-35459.patch
# unconditionally enable freetype lcdfilter support
Patch12: qtbase-opensource-src-5.2.0-enable_ft_lcdfilter.patch
Patch4: qtbase-opensource-src-5.6.2-QTBUG-35459.patch
# upstreamable patches
# 1381828 - Broken window scaling for some QT5 applications (#1381828)
# This patch moves the threshold for 2x scaling from the DPI of 144 to 192,
# the same value GNOME uses. It's not a complete solution...
Patch51: qtbase-hidpi_scale_at_192.patch
# Workaround moc/multilib issues
# https://bugzilla.redhat.com/show_bug.cgi?id=1290020
# https://bugreports.qt.io/browse/QTBUG-49972
Patch52: qtbase-opensource-src-5.6.0-moc_WORDSIZE.patch
# arm patch
Patch54: qtbase-opensource-src-5.6.0-arm.patch
Patch54: qtbase-opensource-src-5.6.2-arm.patch
# recently passed code review, not integrated yet
# https://codereview.qt-project.org/126102/
Patch60: moc-get-the-system-defines-from-the-compiler-itself.patch
Patch60: qtbase-opensource-src-5.6.2-moc_system_defines.patch
# drop -O3 and make -O2 by default
Patch61: qt5-qtbase-cxxflag.patch
## upstream patches
Patch101: 0001-xcb-Properly-interpret-data.l-0-field-of-XdndStatus-.patch
Patch111: 0011-XCB-Auto-detect-xcb-glx-also-with-xcb-qt.patch
Patch132: 0032-xcb-Fix-drop-of-text-uri-list-and-text-html.patch
Patch133: 0033-xcb-Fix-dropping-URL-on-Firefox-window.patch
Patch148: 0148-xcb-Disable-GLX-pbuffers-with-Chromium-in-VMs.patch
Patch155: 0155-xcb-Fix-transient-parent-and-Qt-Window-flag.patch
Patch19: 0019-xcb-Don-t-send-Qt-WindowNoState-event-when-hiding-mi.patch
Patch32: 0032-XCB-Drop-from-external-app-fix-keyboard-modifier-sta.patch
Patch36: 0036-xcb-Use-the-state-of-the-key-event-to-process-it.patch
Patch84: 0084-xcb-Treat-bitmap-cursors-differently-from-shaped-cur.patch
Patch98: 0098-Plug-QMimeData-leaks-in-QXcbClipboard.patch
Patch145: 0145-QXcbShmImage-don-t-use-shmget-s-return-unless-it-suc.patch
Patch177: 0177-xcb-fix-passing-of-focus-from-child-to-its-top-level.patch
Patch190: 0190-qxcbconnection.cpp-fix-warning-about-unused-function.patch
Patch237: 0237-Stop-unloading-plugins-in-QPluginLoader-and-QFactory.patch
Patch263: 0263-xcb-Warn-and-bail-out-when-even-the-basic-dummy-cont.patch
Patch276: 0276-QClipboard-Fix-emitting-changed-in-XCB.patch
## upstream patches (under review)
# https://codereview.qt-project.org/#/c/161056/
Patch401: 0001-Merge-the-QDBusMetaType-s-custom-information-to-QDBu.patch
Patch402: 0002-Fix-some-QtDBus-crashes-during-application-destructi.patch
## upstream patches (5.8 branch)
Patch500: qt5-qtbase-5.8-QTBUG-56140.patch
# macros, be mindful to keep sync'd with macros.qt5
Source10: macros.qt5
@ -137,8 +150,13 @@ Source10: macros.qt5
# RPM drag in gtk2 as a dependency for the GTK+ 2 dialog support.
%global __requires_exclude_from ^%{_qt5_plugindir}/platformthemes/.*$
# for %%check
BuildRequires: cmake
# for %%check, rpm auto-provides
%if 0%{?fedora}
BuildRequires: cmake >= 3
%endif
%if 0%{?epel}
BuildRequires: cmake3
%endif
BuildRequires: cups-devel
BuildRequires: desktop-file-utils
BuildRequires: findutils
@ -179,6 +197,9 @@ BuildRequires: pkgconfig(xkbcommon-x11) >= 0.4.1
Provides: bundled(libxkbcommon) = 0.4.1
%endif
BuildRequires: pkgconfig(xkeyboard-config)
%if 0%{?fedora} || 0%{?rhel} > 7
%global eglfs 1
%endif
%if 0%{?fedora} || 0%{?rhel} > 6
%define egl 1
BuildRequires: pkgconfig(egl)
@ -343,6 +364,12 @@ Summary: RPM macros for Qt5
# https://bugzilla.redhat.com/show_bug.cgi?id=1248174
Requires: redhat-rpm-config
%endif
%if 0%{?fedora}
Requires: cmake >= 3
%endif
%if 0%{?epel}
Requires: cmake3
%endif
# when qt5-rpm-macros was split out
Conflicts: qt5-qtbase-devel < 5.6.0-0.23
BuildArch: noarch
@ -353,21 +380,36 @@ RPM macros for building Qt5 packages.
%prep
%setup -q -n %{qt_module}-opensource-src-%{version}%{?prerelease:-%{prerelease}}
%patch4 -p1 -b .QTBUG-35459
%patch12 -p1 -b .enable_ft_lcdfilter
## upstream patches
%patch19 -p1 -b .0019
%patch32 -p1 -b .0032
%patch36 -p1 -b .0036
%patch84 -p1 -b .0084
%patch98 -p1 -b .0098
%patch145 -p1 -b .0145
%patch177 -p1 -b .0177
%patch190 -p1 -b .0190
%patch237 -p1 -b .0237
%patch263 -p1 -b .0263
%patch276 -p1 -b .0276
## upstream patches (under review)
%patch401 -p1 -b .0401
%patch402 -p1 -b .0402
## upstream patches (5.8)
%patch500 -p1 -b .QTBUG-56140
## downstream patches
%patch4 -p1 -b .QTBUG-35459
%patch51 -p1 -b .hidpi_scale_at_192
%patch52 -p1 -b .moc_WORDSIZE
%patch54 -p1 -b .arm
%patch60 -p1 -b .moc_system_defines
%patch61 -p1 -b .qt5-qtbase-cxxflag
%patch101 -p1 -b .0001-xcb
%patch111 -p1 -b .0011
%patch132 -p1 -b .0032
%patch133 -p1 -b .0033
%patch148 -p1 -b .0148
%patch155 -p1 -b .0155
%define platform linux-g++
%if 0%{?inject_optflags}
@ -941,6 +983,10 @@ fi
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QEglFSX11IntegrationPlugin.cmake
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QXcbEglIntegrationPlugin.cmake
%endif
%if 0%{?eglfs}
%{_qt5_plugindir}/egldeviceintegrations/libqeglfs-kms-egldevice-integration.so
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QEglFSKmsEglDeviceIntegrationPlugin.cmake
%endif
%{_qt5_plugindir}/platforms/libqlinuxfb.so
%{_qt5_plugindir}/platforms/libqminimal.so
%{_qt5_plugindir}/platforms/libqoffscreen.so
@ -961,6 +1007,26 @@ fi
%changelog
* Mon May 08 2017 Rex Dieter <rdieter@fedoraproject.org> - 5.6.2-4
- pull in recommended qtdbus patches
* Mon Feb 13 2017 Rex Dieter <rdieter@fedoraproject.org> - 5.6.2-3
- macros.qt5: +%%_qt5_qmldir macro
- pull in xcb-related upstream fixes
- backport hidpi-related patches from f25 branch
* Wed Dec 07 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.6.2-2
- BR: perl-generators
* Sun Oct 16 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.6.2-1
- 5.6.2
* Tue Sep 27 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.6.1-5
- cmake3 available only in epel
* Tue Aug 02 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.6.1-4
- qt5-rpm-macros: Requires: cmake(3)
* Tue Jun 14 2016 Rex Dieter <rdieter@fedoraproject.org> - 5.6.1-3
- backport some xcb-plugin-related fixes

View File

@ -0,0 +1,12 @@
diff -up qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb/qxcbscreen.cpp.hidpi_scale_at_192 qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb/qxcbscreen.cpp
--- qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb/qxcbscreen.cpp.hidpi_scale_at_192 2017-02-09 07:47:26.060096259 -0600
+++ qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb/qxcbscreen.cpp 2017-02-09 07:48:11.497567447 -0600
@@ -633,7 +633,7 @@ void QXcbScreen::updateGeometry(const QR
m_sizeMillimeters = sizeInMillimeters(xGeometry.size(), virtualDpi());
qreal dpi = xGeometry.width() / physicalSize().width() * qreal(25.4);
- m_pixelDensity = qMax(1, qRound(dpi/96));
+ m_pixelDensity = qMax(1, (int) (dpi/96)); // instead of rounding at 1.5, round at 2.0 (same as GNOME)
m_geometry = QRect(xGeometry.topLeft(), xGeometry.size());
m_availableGeometry = xGeometry & m_virtualDesktop->workArea();
QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry);

View File

@ -1,12 +0,0 @@
diff -up qtbase-opensource-src-5.2.0/src/gui/text/qfontengine_ft.cpp.lcdfilter qtbase-opensource-src-5.2.0/src/gui/text/qfontengine_ft.cpp
--- qtbase-opensource-src-5.2.0/src/gui/text/qfontengine_ft.cpp.lcdfilter 2013-12-08 11:09:51.000000000 -0600
+++ qtbase-opensource-src-5.2.0/src/gui/text/qfontengine_ft.cpp 2014-01-27 13:09:28.426065603 -0600
@@ -69,7 +69,7 @@
#include FT_CONFIG_OPTIONS_H
#endif
-#if defined(FT_LCD_FILTER_H) && defined(FT_CONFIG_OPTION_SUBPIXEL_RENDERING)
+#if defined(FT_LCD_FILTER_H)
#define QT_USE_FREETYPE_LCDFILTER
#endif

View File

@ -1,13 +0,0 @@
diff -up qtbase-opensource-src-5.3.2/src/xml/sax/qxml.cpp.QTBUG-35459 qtbase-opensource-src-5.3.2/src/xml/sax/qxml.cpp
diff -up qtbase-opensource-src-5.3.2/src/xml/sax/qxml_p.h.QTBUG-35459 qtbase-opensource-src-5.3.2/src/xml/sax/qxml_p.h
--- qtbase-opensource-src-5.3.2/src/xml/sax/qxml_p.h.QTBUG-35459 2014-09-11 05:48:05.000000000 -0500
+++ qtbase-opensource-src-5.3.2/src/xml/sax/qxml_p.h 2014-09-16 09:35:01.189255615 -0500
@@ -223,7 +223,7 @@ private:
// for the DTD currently being parsed.
static const int dtdRecursionLimit = 2;
// The maximum amount of characters an entity value may contain, after expansion.
- static const int entityCharacterLimit = 1024;
+ static const int entityCharacterLimit = 65536;
const QString &string();
void stringClear();

View File

@ -1,13 +0,0 @@
diff -up qtbase-opensource-src-5.6.0-beta/configure.than qtbase-opensource-src-5.6.0-beta/configure
--- qtbase-opensource-src-5.6.0-beta/configure.than 2016-02-12 13:56:20.057741037 +0100
+++ qtbase-opensource-src-5.6.0-beta/configure 2016-02-12 14:10:10.267768256 +0100
@@ -4346,6 +4346,9 @@ if [ "$QMAKESPEC" != "$XQMAKESPEC" ]; th
else
# not cross compiling, host == target
CFG_HOST_ARCH="$CFG_ARCH"
+ if [ "$CFG_ARCH" = "arm" ] ; then
+ CFG_CPUFEATURES="neon"
+ fi
CFG_HOST_CPUFEATURES="$CFG_CPUFEATURES"
fi
unset OUTFILE

View File

@ -0,0 +1,12 @@
diff -up qtbase-opensource-src-5.6.2/src/xml/sax/qxml_p.h.QTBUG-35459 qtbase-opensource-src-5.6.2/src/xml/sax/qxml_p.h
--- qtbase-opensource-src-5.6.2/src/xml/sax/qxml_p.h.QTBUG-35459 2016-09-16 00:49:42.000000000 -0500
+++ qtbase-opensource-src-5.6.2/src/xml/sax/qxml_p.h 2016-10-16 08:40:04.441725330 -0500
@@ -217,7 +217,7 @@ private:
// for the DTD currently being parsed.
static const int dtdRecursionLimit = 2;
// The maximum amount of characters an entity value may contain, after expansion.
- static const int entityCharacterLimit = 1024;
+ static const int entityCharacterLimit = 65536;
const QString &string();
void stringClear();

View File

@ -0,0 +1,13 @@
diff -up qtbase-opensource-src-5.6.2/configure.arm qtbase-opensource-src-5.6.2/configure
--- qtbase-opensource-src-5.6.2/configure.arm 2016-09-16 00:49:42.000000000 -0500
+++ qtbase-opensource-src-5.6.2/configure 2016-10-16 08:41:20.583267295 -0500
@@ -4373,6 +4373,9 @@ if [ "$QMAKESPEC" != "$XQMAKESPEC" ]; th
else
# not cross compiling, host == target
CFG_HOST_ARCH="$CFG_ARCH"
+ if [ "$CFG_ARCH" = "arm" ] ; then
+ CFG_CPUFEATURES="neon"
+ fi
CFG_HOST_CPUFEATURES="$CFG_CPUFEATURES"
fi
unset OUTFILE

View File

@ -1,39 +1,6 @@
From fa0d02eedcacc22db1026b902801b29176755362 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Fri, 21 Aug 2015 17:08:19 -0700
Subject: [PATCH] moc: get the system #defines from the compiler itself
In order for moc to properly parse #ifdefs and family, we've had
QMAKE_COMPILER_DEFINES as a list of pre-defined macros from the
compiler. That list is woefully incomplete.
Instead, let's simply ask the compiler for the list. With GCC and
family, we use the -dM flag while preprocessing. With ICC on Windows,
the flag gains an extra "Q" but is otherwise the same. For MSVC, it
requires using some undocumented switches and parsing environment
variables (I've tested MSVC 2012, 2013 and 2015).
The new moc option is called --include to be similar to GCC's -include
option. It does more than just parse a list of pre-defined macros and
can be used to insert any sort of code that moc needs to parse prior to
the main file.
Change-Id: I7de033f80b0e4431b7f1ffff13fca02dbb60a0a6
---
mkspecs/features/moc.prf | 31 +++++++++++++--
qmake/main.cpp | 38 +++++++++++++++++++
src/tools/moc/main.cpp | 16 +++++++-
src/tools/moc/preprocessor.cpp | 60 +++++++++++++++++-------------
src/tools/moc/preprocessor.h | 1 +
tests/auto/tools/moc/subdir/extradefines.h | 1 +
tests/auto/tools/moc/tst_moc.cpp | 42 +++++++++++++++++++++
7 files changed, 158 insertions(+), 31 deletions(-)
create mode 100644 tests/auto/tools/moc/subdir/extradefines.h
diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf
index c0b5682..af885c3 100644
--- a/mkspecs/features/moc.prf
+++ b/mkspecs/features/moc.prf
diff -up qtbase-opensource-src-5.6.2/mkspecs/features/moc.prf.moc_system_defines qtbase-opensource-src-5.6.2/mkspecs/features/moc.prf
--- qtbase-opensource-src-5.6.2/mkspecs/features/moc.prf.moc_system_defines 2016-09-16 00:49:42.000000000 -0500
+++ qtbase-opensource-src-5.6.2/mkspecs/features/moc.prf 2016-10-16 08:42:20.561694271 -0500
@@ -24,8 +24,25 @@ win32:count(MOC_INCLUDEPATH, 40, >) {
write_file($$absolute_path($$WIN_INCLUDETEMP, $$OUT_PWD), WIN_INCLUDETEMP_CONT)|error("Aborting.")
}
@ -76,7 +43,7 @@ index c0b5682..af885c3 100644
return($$RET)
}
@@ -46,7 +69,7 @@ moc_header.output = $$MOC_DIR/$${QMAKE_H_MOD_MOC}${QMAKE_FILE_BASE}$${first(QMAK
@@ -46,7 +69,7 @@ moc_header.output = $$MOC_DIR/$${QMAKE_H
moc_header.input = HEADERS
moc_header.variable_out = SOURCES
moc_header.name = MOC ${QMAKE_FILE_IN}
@ -85,7 +52,7 @@ index c0b5682..af885c3 100644
silent:moc_header.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_header.commands
QMAKE_EXTRA_COMPILERS += moc_header
INCREDIBUILD_XGE += moc_header
@@ -58,7 +81,7 @@ moc_source.commands = ${QMAKE_FUNC_mocCmdBase} ${QMAKE_FILE_IN} -o ${QMAKE_FILE_
@@ -58,7 +81,7 @@ moc_source.commands = ${QMAKE_FUNC_mocCm
moc_source.output = $$MOC_DIR/$${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_EXT_CPP_MOC}
moc_source.input = SOURCES OBJECTIVE_SOURCES
moc_source.name = MOC ${QMAKE_FILE_IN}
@ -94,10 +61,9 @@ index c0b5682..af885c3 100644
silent:moc_source.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_source.commands
QMAKE_EXTRA_COMPILERS += moc_source
INCREDIBUILD_XGE += moc_source
diff --git a/qmake/main.cpp b/qmake/main.cpp
index bde537d..e9b8bde 100644
--- a/qmake/main.cpp
+++ b/qmake/main.cpp
diff -up qtbase-opensource-src-5.6.2/qmake/main.cpp.moc_system_defines qtbase-opensource-src-5.6.2/qmake/main.cpp
--- qtbase-opensource-src-5.6.2/qmake/main.cpp.moc_system_defines 2016-09-16 00:49:42.000000000 -0500
+++ qtbase-opensource-src-5.6.2/qmake/main.cpp 2016-10-16 08:42:20.561694271 -0500
@@ -1,6 +1,7 @@
/****************************************************************************
**
@ -117,7 +83,7 @@ index bde537d..e9b8bde 100644
QT_BEGIN_NAMESPACE
#ifdef Q_OS_WIN
@@ -246,6 +251,30 @@ static int doInstall(int argc, char **argv)
@@ -246,6 +251,30 @@ static int doInstall(int argc, char **ar
return 3;
}
@ -164,11 +130,10 @@ index bde537d..e9b8bde 100644
#endif
QMakeVfs vfs;
diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp
index a5cbad7..d06335d 100644
--- a/src/tools/moc/main.cpp
+++ b/src/tools/moc/main.cpp
@@ -259,6 +259,11 @@ int runMoc(int argc, char **argv)
diff -up qtbase-opensource-src-5.6.2/src/tools/moc/main.cpp.moc_system_defines qtbase-opensource-src-5.6.2/src/tools/moc/main.cpp
--- qtbase-opensource-src-5.6.2/src/tools/moc/main.cpp.moc_system_defines 2016-10-16 08:42:20.558694249 -0500
+++ qtbase-opensource-src-5.6.2/src/tools/moc/main.cpp 2016-10-16 08:42:20.562694278 -0500
@@ -263,6 +263,11 @@ int runMoc(int argc, char **argv)
prependIncludeOption.setValueName(QStringLiteral("file"));
parser.addOption(prependIncludeOption);
@ -180,7 +145,7 @@ index a5cbad7..d06335d 100644
QCommandLineOption noNotesWarningsCompatOption(QStringLiteral("n"));
noNotesWarningsCompatOption.setDescription(QStringLiteral("Do not display notes (-nn) or warnings (-nw). Compatibility option."));
noNotesWarningsCompatOption.setValueName(QStringLiteral("which"));
@@ -406,7 +411,16 @@ int runMoc(int argc, char **argv)
@@ -412,7 +417,16 @@ int runMoc(int argc, char **argv)
moc.includes = pp.includes;
// 1. preprocess
@ -198,11 +163,10 @@ index a5cbad7..d06335d 100644
if (!pp.preprocessOnly) {
// 2. parse
diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp
index d036c40..70cf14a 100644
--- a/src/tools/moc/preprocessor.cpp
+++ b/src/tools/moc/preprocessor.cpp
@@ -1001,6 +1001,37 @@ static void mergeStringLiterals(Symbols *_symbols)
diff -up qtbase-opensource-src-5.6.2/src/tools/moc/preprocessor.cpp.moc_system_defines qtbase-opensource-src-5.6.2/src/tools/moc/preprocessor.cpp
--- qtbase-opensource-src-5.6.2/src/tools/moc/preprocessor.cpp.moc_system_defines 2016-09-16 00:49:42.000000000 -0500
+++ qtbase-opensource-src-5.6.2/src/tools/moc/preprocessor.cpp 2016-10-16 08:42:20.562694278 -0500
@@ -1007,6 +1007,37 @@ static void mergeStringLiterals(Symbols
}
}
@ -240,7 +204,7 @@ index d036c40..70cf14a 100644
void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed)
{
currentFilenames.push(filename);
@@ -1021,33 +1052,9 @@ void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed)
@@ -1027,33 +1058,9 @@ void Preprocessor::preprocess(const QByt
continue;
until(PP_NEWLINE);
@ -276,7 +240,7 @@ index d036c40..70cf14a 100644
if (Preprocessor::preprocessedIncludes.contains(include))
continue;
@@ -1202,6 +1209,7 @@ Symbols Preprocessor::preprocessed(const QByteArray &filename, QFile *file)
@@ -1208,6 +1215,7 @@ Symbols Preprocessor::preprocessed(const
input = cleaned(input);
// phase 2: tokenize for the preprocessor
@ -284,10 +248,9 @@ index d036c40..70cf14a 100644
symbols = tokenize(input);
#if 0
diff --git a/src/tools/moc/preprocessor.h b/src/tools/moc/preprocessor.h
index 9c81f86..d876caf 100644
--- a/src/tools/moc/preprocessor.h
+++ b/src/tools/moc/preprocessor.h
diff -up qtbase-opensource-src-5.6.2/src/tools/moc/preprocessor.h.moc_system_defines qtbase-opensource-src-5.6.2/src/tools/moc/preprocessor.h
--- qtbase-opensource-src-5.6.2/src/tools/moc/preprocessor.h.moc_system_defines 2016-09-16 00:49:42.000000000 -0500
+++ qtbase-opensource-src-5.6.2/src/tools/moc/preprocessor.h 2016-10-16 08:42:20.562694278 -0500
@@ -67,6 +67,7 @@ public:
QList<QByteArray> frameworks;
QSet<QByteArray> preprocessedIncludes;
@ -296,18 +259,15 @@ index 9c81f86..d876caf 100644
Symbols preprocessed(const QByteArray &filename, QFile *device);
void parseDefineArguments(Macro *m);
diff --git a/tests/auto/tools/moc/subdir/extradefines.h b/tests/auto/tools/moc/subdir/extradefines.h
new file mode 100644
index 0000000..e7888ce
--- /dev/null
+++ b/tests/auto/tools/moc/subdir/extradefines.h
diff -up qtbase-opensource-src-5.6.2/tests/auto/tools/moc/subdir/extradefines.h.moc_system_defines qtbase-opensource-src-5.6.2/tests/auto/tools/moc/subdir/extradefines.h
--- qtbase-opensource-src-5.6.2/tests/auto/tools/moc/subdir/extradefines.h.moc_system_defines 2016-10-16 08:42:20.562694278 -0500
+++ qtbase-opensource-src-5.6.2/tests/auto/tools/moc/subdir/extradefines.h 2016-10-16 08:42:20.562694278 -0500
@@ -0,0 +1 @@
+#define FOO 1
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index fa1b68b..1d6a911 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -552,6 +552,8 @@ private slots:
diff -up qtbase-opensource-src-5.6.2/tests/auto/tools/moc/tst_moc.cpp.moc_system_defines qtbase-opensource-src-5.6.2/tests/auto/tools/moc/tst_moc.cpp
--- qtbase-opensource-src-5.6.2/tests/auto/tools/moc/tst_moc.cpp.moc_system_defines 2016-09-16 00:49:42.000000000 -0500
+++ qtbase-opensource-src-5.6.2/tests/auto/tools/moc/tst_moc.cpp 2016-10-16 08:42:20.562694278 -0500
@@ -581,6 +581,8 @@ private slots:
void frameworkSearchPath();
void cstyleEnums();
void defineMacroViaCmdline();
@ -316,10 +276,20 @@ index fa1b68b..1d6a911 100644
void specifyMetaTagsFromCmdline();
void invokable();
void singleFunctionKeywordSignalAndSlot();
@@ -1219,6 +1221,46 @@ void tst_Moc::defineMacroViaCmdline()
#endif
}
@@ -1248,6 +1250,46 @@ void tst_Moc::defineMacroViaCmdline()
args << m_sourceDirectory + QStringLiteral("/macro-on-cmdline.h");
proc.start(m_moc, args);
+ QVERIFY(proc.waitForFinished());
+ QCOMPARE(proc.exitCode(), 0);
+ QCOMPARE(proc.readAllStandardError(), QByteArray());
+ QByteArray mocOut = proc.readAllStandardOutput();
+ QVERIFY(!mocOut.isEmpty());
+#else
+ QSKIP("Only tested on linux/gcc");
+#endif
+}
+
+void tst_Moc::defineMacroViaForcedInclude()
+{
+#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
@ -350,19 +320,6 @@ index fa1b68b..1d6a911 100644
+ args << m_sourceDirectory + QStringLiteral("/macro-on-cmdline.h");
+
+ proc.start(m_moc, args);
+ QVERIFY(proc.waitForFinished());
+ QCOMPARE(proc.exitCode(), 0);
+ QCOMPARE(proc.readAllStandardError(), QByteArray());
+ QByteArray mocOut = proc.readAllStandardOutput();
+ QVERIFY(!mocOut.isEmpty());
+#else
+ QSKIP("Only tested on linux/gcc");
+#endif
+}
+
// tst_Moc::specifyMetaTagsFromCmdline()
// plugin_metadata.h contains a plugin which we register here. Since we're not building this
// application as a plugin, we need top copy some of the initializer code found in qplugin.h:
--
1.9.3
QVERIFY(proc.waitForFinished());
QCOMPARE(proc.exitCode(), 0);
QCOMPARE(proc.readAllStandardError(), QByteArray());

View File

@ -1 +1 @@
b23232190a3df61fe1ba81636987b036 qtbase-opensource-src-5.6.1.tar.xz
5672bf62a89061a6edb425b7796e4eca qtbase-opensource-src-5.6.2.tar.xz