Compare commits
No commits in common. 'epel9' and 'i10c-beta' have entirely different histories.
@ -1,28 +1 @@
|
||||
/qtbase-everywhere-src-6.0.0.tar.xz
|
||||
/qtbase-everywhere-src-6.0.1.tar.xz
|
||||
/qtbase-everywhere-src-6.0.3.tar.xz
|
||||
/qtbase-everywhere-src-6.1.0.tar.xz
|
||||
/qtbase-everywhere-src-6.1.1.tar.xz
|
||||
/qtbase-everywhere-src-6.1.2.tar.xz
|
||||
/qtbase-everywhere-src-6.2.0-beta3.tar.xz
|
||||
/qtbase-everywhere-src-6.2.0-beta4.tar.xz
|
||||
/qtbase-everywhere-src-6.2.0-rc.tar.xz
|
||||
/qtbase-everywhere-src-6.2.0-rc2.tar.xz
|
||||
/qtbase-everywhere-src-6.2.0.tar.xz
|
||||
/qtbase-everywhere-src-6.2.1.tar.xz
|
||||
/qtbase-everywhere-src-6.2.2.tar.xz
|
||||
/qtbase-everywhere-src-6.2.3.tar.xz
|
||||
/qtbase-everywhere-src-6.3.0.tar.xz
|
||||
/qtbase-everywhere-src-6.3.1.tar.xz
|
||||
/qtbase-everywhere-src-6.4.0.tar.xz
|
||||
/qtbase-everywhere-src-6.4.1.tar.xz
|
||||
/qtbase-everywhere-src-6.4.2.tar.xz
|
||||
/qtbase-everywhere-src-6.4.3.tar.xz
|
||||
/qtbase-everywhere-src-6.5.0.tar.xz
|
||||
/qtbase-everywhere-src-6.5.1.tar.xz
|
||||
/qtbase-everywhere-src-6.5.2.tar.xz
|
||||
/qt-everywhere-src-6.5.3.tar.xz
|
||||
/qtbase-everywhere-src-6.5.3.tar.xz
|
||||
/qtbase-everywhere-src-6.6.0.tar.xz
|
||||
/qtbase-everywhere-src-6.6.1.tar.xz
|
||||
/qtbase-everywhere-src-6.6.2.tar.xz
|
||||
SOURCES/qtbase-everywhere-src-6.7.1.tar.xz
|
||||
|
@ -0,0 +1 @@
|
||||
d056b7d9ab0a16c15dbfac5a4d8e489af2ea23df SOURCES/qtbase-everywhere-src-6.7.1.tar.xz
|
@ -0,0 +1,232 @@
|
||||
From b1e75376cc3adfc7da5502a277dfe9711f3e0536 Mon Sep 17 00:00:00 2001
|
||||
From: Mårten Nordheim <marten.nordheim@qt.io>
|
||||
Date: Tue, 25 Jun 2024 17:09:35 +0200
|
||||
Subject: [PATCH] HTTP2: Delay any communication until encrypted() can be responded to
|
||||
|
||||
We have the encrypted() signal that lets users do extra checks on the
|
||||
established connection. It is emitted as BlockingQueued, so the HTTP
|
||||
thread stalls until it is done emitting. Users can potentially call
|
||||
abort() on the QNetworkReply at that point, which is passed as a Queued
|
||||
call back to the HTTP thread. That means that any currently queued
|
||||
signal emission will be processed before the abort() call is processed.
|
||||
|
||||
In the case of HTTP2 it is a little special since it is multiplexed and
|
||||
the code is built to start requests as they are available. This means
|
||||
that, while the code worked fine for HTTP1, since one connection only
|
||||
has one request, it is not working for HTTP2, since we try to send more
|
||||
requests in-between the encrypted() signal and the abort() call.
|
||||
|
||||
This patch changes the code to delay any communication until the
|
||||
encrypted() signal has been emitted and processed, for HTTP2 only.
|
||||
It's done by adding a few booleans, both to know that we have to return
|
||||
early and so we can keep track of what events arose and what we need to
|
||||
resume once enough time has passed that any abort() call must have been
|
||||
processed.
|
||||
|
||||
Fixes: QTBUG-126610
|
||||
Pick-to: 6.8 6.7 6.5 6.2 5.15 5.12
|
||||
Change-Id: Ic25a600c278203256e35f541026f34a8783235ae
|
||||
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
|
||||
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
||||
---
|
||||
|
||||
diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp
|
||||
index 0abd99b9..3631b13d 100644
|
||||
--- a/src/network/access/qhttp2protocolhandler.cpp
|
||||
+++ b/src/network/access/qhttp2protocolhandler.cpp
|
||||
@@ -303,12 +303,12 @@ bool QHttp2ProtocolHandler::sendRequest()
|
||||
}
|
||||
}
|
||||
|
||||
- if (!prefaceSent && !sendClientPreface())
|
||||
- return false;
|
||||
-
|
||||
if (!requests.size())
|
||||
return true;
|
||||
|
||||
+ if (!prefaceSent && !sendClientPreface())
|
||||
+ return false;
|
||||
+
|
||||
m_channel->state = QHttpNetworkConnectionChannel::WritingState;
|
||||
// Check what was promised/pushed, maybe we do not have to send a request
|
||||
// and have a response already?
|
||||
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
|
||||
index 67669896..1e4161d1 100644
|
||||
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
|
||||
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
|
||||
@@ -209,6 +209,10 @@ void QHttpNetworkConnectionChannel::abort()
|
||||
bool QHttpNetworkConnectionChannel::sendRequest()
|
||||
{
|
||||
Q_ASSERT(protocolHandler);
|
||||
+ if (waitingForPotentialAbort) {
|
||||
+ needInvokeSendRequest = true;
|
||||
+ return false; // this return value is unused
|
||||
+ }
|
||||
return protocolHandler->sendRequest();
|
||||
}
|
||||
|
||||
@@ -221,21 +225,28 @@ bool QHttpNetworkConnectionChannel::sendRequest()
|
||||
void QHttpNetworkConnectionChannel::sendRequestDelayed()
|
||||
{
|
||||
QMetaObject::invokeMethod(this, [this] {
|
||||
- Q_ASSERT(protocolHandler);
|
||||
if (reply)
|
||||
- protocolHandler->sendRequest();
|
||||
+ sendRequest();
|
||||
}, Qt::ConnectionType::QueuedConnection);
|
||||
}
|
||||
|
||||
void QHttpNetworkConnectionChannel::_q_receiveReply()
|
||||
{
|
||||
Q_ASSERT(protocolHandler);
|
||||
+ if (waitingForPotentialAbort) {
|
||||
+ needInvokeReceiveReply = true;
|
||||
+ return;
|
||||
+ }
|
||||
protocolHandler->_q_receiveReply();
|
||||
}
|
||||
|
||||
void QHttpNetworkConnectionChannel::_q_readyRead()
|
||||
{
|
||||
Q_ASSERT(protocolHandler);
|
||||
+ if (waitingForPotentialAbort) {
|
||||
+ needInvokeReadyRead = true;
|
||||
+ return;
|
||||
+ }
|
||||
protocolHandler->_q_readyRead();
|
||||
}
|
||||
|
||||
@@ -1239,7 +1250,18 @@ void QHttpNetworkConnectionChannel::_q_encrypted()
|
||||
if (!h2RequestsToSend.isEmpty()) {
|
||||
// Similar to HTTP/1.1 counterpart below:
|
||||
const auto &pair = std::as_const(h2RequestsToSend).first();
|
||||
+ waitingForPotentialAbort = true;
|
||||
emit pair.second->encrypted();
|
||||
+
|
||||
+ // We don't send or handle any received data until any effects from
|
||||
+ // emitting encrypted() have been processed. This is necessary
|
||||
+ // because the user may have called abort(). We may also abort the
|
||||
+ // whole connection if the request has been aborted and there is
|
||||
+ // no more requests to send.
|
||||
+ QMetaObject::invokeMethod(this,
|
||||
+ &QHttpNetworkConnectionChannel::checkAndResumeCommunication,
|
||||
+ Qt::QueuedConnection);
|
||||
+
|
||||
// In case our peer has sent us its settings (window size, max concurrent streams etc.)
|
||||
// let's give _q_receiveReply a chance to read them first ('invokeMethod', QueuedConnection).
|
||||
}
|
||||
@@ -1257,6 +1279,28 @@ void QHttpNetworkConnectionChannel::_q_encrypted()
|
||||
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
+
|
||||
+void QHttpNetworkConnectionChannel::checkAndResumeCommunication()
|
||||
+{
|
||||
+ Q_ASSERT(connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2
|
||||
+ || connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2Direct);
|
||||
+
|
||||
+ // Because HTTP/2 requires that we send a SETTINGS frame as the first thing we do, and respond
|
||||
+ // to a SETTINGS frame with an ACK, we need to delay any handling until we can ensure that any
|
||||
+ // effects from emitting encrypted() have been processed.
|
||||
+ // This function is called after encrypted() was emitted, so check for changes.
|
||||
+
|
||||
+ if (!reply && h2RequestsToSend.isEmpty())
|
||||
+ abort();
|
||||
+ waitingForPotentialAbort = false;
|
||||
+ if (needInvokeReadyRead)
|
||||
+ _q_readyRead();
|
||||
+ if (needInvokeReceiveReply)
|
||||
+ _q_receiveReply();
|
||||
+ if (needInvokeSendRequest)
|
||||
+ sendRequest();
|
||||
+}
|
||||
+
|
||||
void QHttpNetworkConnectionChannel::requeueHttp2Requests()
|
||||
{
|
||||
const auto h2RequestsToSendCopy = std::exchange(h2RequestsToSend, {});
|
||||
diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h
|
||||
index c42290fe..061f20fd 100644
|
||||
--- a/src/network/access/qhttpnetworkconnectionchannel_p.h
|
||||
+++ b/src/network/access/qhttpnetworkconnectionchannel_p.h
|
||||
@@ -74,6 +74,10 @@ public:
|
||||
QAbstractSocket *socket;
|
||||
bool ssl;
|
||||
bool isInitialized;
|
||||
+ bool waitingForPotentialAbort = false;
|
||||
+ bool needInvokeReceiveReply = false;
|
||||
+ bool needInvokeReadyRead = false;
|
||||
+ bool needInvokeSendRequest = false;
|
||||
ChannelState state;
|
||||
QHttpNetworkRequest request; // current request, only used for HTTP
|
||||
QHttpNetworkReply *reply; // current reply for this request, only used for HTTP
|
||||
@@ -146,6 +150,8 @@ public:
|
||||
void closeAndResendCurrentRequest();
|
||||
void resendCurrentRequest();
|
||||
|
||||
+ void checkAndResumeCommunication();
|
||||
+
|
||||
bool isSocketBusy() const;
|
||||
bool isSocketWriting() const;
|
||||
bool isSocketWaiting() const;
|
||||
diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp
|
||||
index 74be5afd..9e5f94e3 100644
|
||||
--- a/tests/auto/network/access/http2/tst_http2.cpp
|
||||
+++ b/tests/auto/network/access/http2/tst_http2.cpp
|
||||
@@ -106,6 +106,8 @@ private slots:
|
||||
|
||||
void duplicateRequestsWithAborts();
|
||||
|
||||
+ void abortOnEncrypted();
|
||||
+
|
||||
protected slots:
|
||||
// Slots to listen to our in-process server:
|
||||
void serverStarted(quint16 port);
|
||||
@@ -1479,6 +1481,48 @@ void tst_Http2::duplicateRequestsWithAborts()
|
||||
QCOMPARE(finishedCount, ExpectedSuccessfulRequests);
|
||||
}
|
||||
|
||||
+void tst_Http2::abortOnEncrypted()
|
||||
+{
|
||||
+#if !QT_CONFIG(ssl)
|
||||
+ QSKIP("TLS support is needed for this test");
|
||||
+#else
|
||||
+ clearHTTP2State();
|
||||
+ serverPort = 0;
|
||||
+
|
||||
+ ServerPtr targetServer(newServer(defaultServerSettings, H2Type::h2Direct));
|
||||
+
|
||||
+ QMetaObject::invokeMethod(targetServer.data(), "startServer", Qt::QueuedConnection);
|
||||
+ runEventLoop();
|
||||
+
|
||||
+ nRequests = 1;
|
||||
+ nSentRequests = 0;
|
||||
+
|
||||
+ const auto url = requestUrl(H2Type::h2Direct);
|
||||
+ QNetworkRequest request(url);
|
||||
+ request.setAttribute(QNetworkRequest::Http2DirectAttribute, true);
|
||||
+
|
||||
+ std::unique_ptr<QNetworkReply> reply{manager->get(request)};
|
||||
+ reply->ignoreSslErrors();
|
||||
+ connect(reply.get(), &QNetworkReply::encrypted, reply.get(), [reply = reply.get()](){
|
||||
+ reply->abort();
|
||||
+ });
|
||||
+ connect(reply.get(), &QNetworkReply::errorOccurred, this, &tst_Http2::replyFinishedWithError);
|
||||
+
|
||||
+ runEventLoop();
|
||||
+ STOP_ON_FAILURE
|
||||
+
|
||||
+ QCOMPARE(nRequests, 0);
|
||||
+ QCOMPARE(reply->error(), QNetworkReply::OperationCanceledError);
|
||||
+
|
||||
+ const bool res = QTest::qWaitFor(
|
||||
+ [this, server = targetServer.get()]() {
|
||||
+ return serverGotSettingsACK || prefaceOK || nSentRequests > 0;
|
||||
+ },
|
||||
+ 500);
|
||||
+ QVERIFY(!res);
|
||||
+#endif // QT_CONFIG(ssl)
|
||||
+}
|
||||
+
|
||||
void tst_Http2::serverStarted(quint16 port)
|
||||
{
|
||||
serverPort = port;
|
@ -0,0 +1,310 @@
|
||||
From d0b4e8a601bc2f81ddb23c124acc99defa26c02f Mon Sep 17 00:00:00 2001
|
||||
From: Jan Grulich <jgrulich@redhat.com>
|
||||
Date: Fri, 22 Mar 2024 12:12:51 +0100
|
||||
Subject: [PATCH] QGtk3Theme: Add support for xdg-desktop-portal to get color scheme
|
||||
|
||||
Use xdg-desktop-portal to get color scheme used by GNOME. Recent GNOME
|
||||
versions use this as primary way to switch between light and dark theme.
|
||||
Make this a preferred way to get color scheme and fallback to previous
|
||||
methods in case xdg-desktop-portal cannot be used. Also update app theme
|
||||
on runtime when color scheme changes, not only when theme is changed.
|
||||
|
||||
[ChangeLog][Platform Specific Changes][Linux] Add support for
|
||||
xdg-desktop-portal to get color scheme in QGtk3Theme.
|
||||
|
||||
Fixes: QTBUG-116197
|
||||
Change-Id: Ib3ffad405bc795ed6f4de4af411efc45721662b9
|
||||
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
||||
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
|
||||
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
|
||||
---
|
||||
|
||||
diff --git a/src/plugins/platformthemes/gtk3/CMakeLists.txt b/src/plugins/platformthemes/gtk3/CMakeLists.txt
|
||||
index becfccc..6d3c7bf 100644
|
||||
--- a/src/plugins/platformthemes/gtk3/CMakeLists.txt
|
||||
+++ b/src/plugins/platformthemes/gtk3/CMakeLists.txt
|
||||
@@ -35,6 +35,13 @@
|
||||
Qt::GuiPrivate
|
||||
)
|
||||
|
||||
+qt_internal_extend_target(QGtk3ThemePlugin CONDITION QT_FEATURE_dbus
|
||||
+ SOURCES
|
||||
+ qgtk3portalinterface.cpp
|
||||
+ LIBRARIES
|
||||
+ Qt::DBus
|
||||
+)
|
||||
+
|
||||
qt_internal_extend_target(QGtk3ThemePlugin CONDITION QT_FEATURE_xlib
|
||||
LIBRARIES
|
||||
X11::X11
|
||||
diff --git a/src/plugins/platformthemes/gtk3/qgtk3portalinterface.cpp b/src/plugins/platformthemes/gtk3/qgtk3portalinterface.cpp
|
||||
new file mode 100644
|
||||
index 0000000..1ffdda7
|
||||
--- /dev/null
|
||||
+++ b/src/plugins/platformthemes/gtk3/qgtk3portalinterface.cpp
|
||||
@@ -0,0 +1,123 @@
|
||||
+// Copyright (C) 2024 The Qt Company Ltd.
|
||||
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
+
|
||||
+//
|
||||
+// W A R N I N G
|
||||
+// -------------
|
||||
+//
|
||||
+// This file is not part of the Qt API. It exists purely as an
|
||||
+// implementation detail. This header file may change from version to
|
||||
+// version without notice, or even be removed.
|
||||
+//
|
||||
+// We mean it.
|
||||
+//
|
||||
+
|
||||
+#include "qgtk3portalinterface_p.h"
|
||||
+#include "qgtk3storage_p.h"
|
||||
+
|
||||
+#include <QtDBus/QDBusArgument>
|
||||
+#include <QtDBus/QDBusConnection>
|
||||
+#include <QtDBus/QDBusMessage>
|
||||
+#include <QtDBus/QDBusPendingCall>
|
||||
+#include <QtDBus/QDBusPendingCallWatcher>
|
||||
+#include <QtDBus/QDBusPendingReply>
|
||||
+#include <QtDBus/QDBusVariant>
|
||||
+#include <QtDBus/QtDBus>
|
||||
+
|
||||
+QT_BEGIN_NAMESPACE
|
||||
+
|
||||
+Q_LOGGING_CATEGORY(lcQGtk3PortalInterface, "qt.qpa.gtk");
|
||||
+
|
||||
+using namespace Qt::StringLiterals;
|
||||
+
|
||||
+static constexpr QLatin1StringView appearanceInterface("org.freedesktop.appearance");
|
||||
+static constexpr QLatin1StringView colorSchemeKey("color-scheme");
|
||||
+
|
||||
+const QDBusArgument &operator>>(const QDBusArgument &argument, QMap<QString, QVariantMap> &map)
|
||||
+{
|
||||
+ argument.beginMap();
|
||||
+ map.clear();
|
||||
+
|
||||
+ while (!argument.atEnd()) {
|
||||
+ QString key;
|
||||
+ QVariantMap value;
|
||||
+ argument.beginMapEntry();
|
||||
+ argument >> key >> value;
|
||||
+ argument.endMapEntry();
|
||||
+ map.insert(key, value);
|
||||
+ }
|
||||
+
|
||||
+ argument.endMap();
|
||||
+ return argument;
|
||||
+}
|
||||
+
|
||||
+QGtk3PortalInterface::QGtk3PortalInterface(QGtk3Storage *s)
|
||||
+ : m_storage(s) {
|
||||
+ qRegisterMetaType<QDBusVariant>();
|
||||
+ qDBusRegisterMetaType<QMap<QString, QVariantMap>>();
|
||||
+
|
||||
+ queryColorScheme();
|
||||
+
|
||||
+ if (!s) {
|
||||
+ qCDebug(lcQGtk3PortalInterface) << "QGtk3PortalInterface instantiated without QGtk3Storage."
|
||||
+ << "No reaction to runtime theme changes.";
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+Qt::ColorScheme QGtk3PortalInterface::colorScheme() const
|
||||
+{
|
||||
+ return m_colorScheme;
|
||||
+}
|
||||
+
|
||||
+void QGtk3PortalInterface::queryColorScheme() {
|
||||
+ QDBusConnection connection = QDBusConnection::sessionBus();
|
||||
+ QDBusMessage message = QDBusMessage::createMethodCall(
|
||||
+ "org.freedesktop.portal.Desktop"_L1,
|
||||
+ "/org/freedesktop/portal/desktop"_L1,
|
||||
+ "org.freedesktop.portal.Settings"_L1, "ReadAll"_L1);
|
||||
+ message << QStringList{ appearanceInterface };
|
||||
+
|
||||
+ QDBusPendingCall pendingCall = connection.asyncCall(message);
|
||||
+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingCall, this);
|
||||
+ QObject::connect(
|
||||
+ watcher, &QDBusPendingCallWatcher::finished, this,
|
||||
+ [this](QDBusPendingCallWatcher *watcher) {
|
||||
+ QDBusPendingReply<QMap<QString, QVariantMap>> reply = *watcher;
|
||||
+ if (reply.isValid()) {
|
||||
+ QMap<QString, QVariantMap> settings = reply.value();
|
||||
+ if (!settings.isEmpty()) {
|
||||
+ settingChanged(appearanceInterface, colorSchemeKey,
|
||||
+ QDBusVariant(settings.value(appearanceInterface).value(colorSchemeKey)));
|
||||
+ }
|
||||
+ } else {
|
||||
+ qCDebug(lcQGtk3PortalInterface) << "Failed to query org.freedesktop.portal.Settings: "
|
||||
+ << reply.error().message();
|
||||
+ }
|
||||
+ watcher->deleteLater();
|
||||
+ });
|
||||
+
|
||||
+ QDBusConnection::sessionBus().connect(
|
||||
+ "org.freedesktop.portal.Desktop"_L1, "/org/freedesktop/portal/desktop"_L1,
|
||||
+ "org.freedesktop.portal.Settings"_L1, "SettingChanged"_L1, this,
|
||||
+ SLOT(settingChanged(QString, QString, QDBusVariant)));
|
||||
+}
|
||||
+
|
||||
+void QGtk3PortalInterface::settingChanged(const QString &group, const QString &key,
|
||||
+ const QDBusVariant &value)
|
||||
+{
|
||||
+ if (group == appearanceInterface && key == colorSchemeKey) {
|
||||
+ const uint colorScheme = value.variant().toUInt();
|
||||
+ // From org.freedesktop.portal.Settings.xml
|
||||
+ // "1" - Prefer dark appearance
|
||||
+ Qt::ColorScheme newColorScheme = colorScheme == 1 ? Qt::ColorScheme::Dark : Qt::ColorScheme::Light;
|
||||
+ if (m_colorScheme != newColorScheme) {
|
||||
+ m_colorScheme = newColorScheme;
|
||||
+ if (m_storage)
|
||||
+ m_storage->handleThemeChange();
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+QT_END_NAMESPACE
|
||||
+
|
||||
+#include "moc_qgtk3portalinterface_p.cpp"
|
||||
diff --git a/src/plugins/platformthemes/gtk3/qgtk3portalinterface_p.h b/src/plugins/platformthemes/gtk3/qgtk3portalinterface_p.h
|
||||
new file mode 100644
|
||||
index 0000000..25a5f58
|
||||
--- /dev/null
|
||||
+++ b/src/plugins/platformthemes/gtk3/qgtk3portalinterface_p.h
|
||||
@@ -0,0 +1,49 @@
|
||||
+// Copyright (C) 2024 The Qt Company Ltd.
|
||||
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
+
|
||||
+#ifndef QGTK3PORTALINTERFACE_H
|
||||
+#define QGTK3PORTALINTERFACE_H
|
||||
+
|
||||
+//
|
||||
+// W A R N I N G
|
||||
+// -------------
|
||||
+//
|
||||
+// This file is not part of the Qt API. It exists purely as an
|
||||
+// implementation detail. This header file may change from version to
|
||||
+// version without notice, or even be removed.
|
||||
+//
|
||||
+// We mean it.
|
||||
+//
|
||||
+
|
||||
+#include <QtCore/QObject>
|
||||
+#include <QtCore/QLoggingCategory>
|
||||
+
|
||||
+QT_BEGIN_NAMESPACE
|
||||
+
|
||||
+class QDBusVariant;
|
||||
+class QGtk3Storage;
|
||||
+
|
||||
+Q_DECLARE_LOGGING_CATEGORY(lcQGtk3PortalInterface);
|
||||
+
|
||||
+class QGtk3PortalInterface : public QObject
|
||||
+{
|
||||
+ Q_OBJECT
|
||||
+public:
|
||||
+ QGtk3PortalInterface(QGtk3Storage *s);
|
||||
+ ~QGtk3PortalInterface() = default;
|
||||
+
|
||||
+ Qt::ColorScheme colorScheme() const;
|
||||
+
|
||||
+private Q_SLOTS:
|
||||
+ void settingChanged(const QString &group, const QString &key,
|
||||
+ const QDBusVariant &value);
|
||||
+private:
|
||||
+ void queryColorScheme();
|
||||
+
|
||||
+ Qt::ColorScheme m_colorScheme = Qt::ColorScheme::Unknown;
|
||||
+ QGtk3Storage *m_storage = nullptr;
|
||||
+};
|
||||
+
|
||||
+QT_END_NAMESPACE
|
||||
+
|
||||
+#endif // QGTK3PORTALINTERFACE_H
|
||||
diff --git a/src/plugins/platformthemes/gtk3/qgtk3storage.cpp b/src/plugins/platformthemes/gtk3/qgtk3storage.cpp
|
||||
index 90c0282..2877b28 100644
|
||||
--- a/src/plugins/platformthemes/gtk3/qgtk3storage.cpp
|
||||
+++ b/src/plugins/platformthemes/gtk3/qgtk3storage.cpp
|
||||
@@ -21,6 +21,9 @@
|
||||
QGtk3Storage::QGtk3Storage()
|
||||
{
|
||||
m_interface.reset(new QGtk3Interface(this));
|
||||
+#if QT_CONFIG(dbus)
|
||||
+ m_portalInterface.reset(new QGtk3PortalInterface(this));
|
||||
+#endif
|
||||
populateMap();
|
||||
}
|
||||
|
||||
@@ -273,7 +276,6 @@
|
||||
*/
|
||||
void QGtk3Storage::handleThemeChange()
|
||||
{
|
||||
- clear();
|
||||
populateMap();
|
||||
QWindowSystemInterface::handleThemeChange();
|
||||
}
|
||||
@@ -331,21 +333,32 @@
|
||||
static QString m_themeName;
|
||||
|
||||
// Distiguish initialization, theme change or call without theme change
|
||||
+ Qt::ColorScheme newColorScheme = Qt::ColorScheme::Unknown;
|
||||
const QString newThemeName = themeName();
|
||||
- if (m_themeName == newThemeName)
|
||||
+
|
||||
+#if QT_CONFIG(dbus)
|
||||
+ // Prefer color scheme we get from xdg-desktop-portal as this is what GNOME
|
||||
+ // relies on these days
|
||||
+ newColorScheme = m_portalInterface->colorScheme();
|
||||
+#endif
|
||||
+
|
||||
+ if (newColorScheme == Qt::ColorScheme::Unknown) {
|
||||
+ // Derive color scheme from theme name
|
||||
+ newColorScheme = newThemeName.contains("dark"_L1, Qt::CaseInsensitive)
|
||||
+ ? Qt::ColorScheme::Dark : m_interface->colorSchemeByColors();
|
||||
+ }
|
||||
+
|
||||
+ if (m_themeName == newThemeName && m_colorScheme == newColorScheme)
|
||||
return;
|
||||
|
||||
clear();
|
||||
|
||||
- // Derive color scheme from theme name
|
||||
- m_colorScheme = newThemeName.contains("dark"_L1, Qt::CaseInsensitive)
|
||||
- ? Qt::ColorScheme::Dark : m_interface->colorSchemeByColors();
|
||||
-
|
||||
if (m_themeName.isEmpty()) {
|
||||
- qCDebug(lcQGtk3Interface) << "GTK theme initialized:" << newThemeName << m_colorScheme;
|
||||
+ qCDebug(lcQGtk3Interface) << "GTK theme initialized:" << newThemeName << newColorScheme;
|
||||
} else {
|
||||
- qCDebug(lcQGtk3Interface) << "GTK theme changed to:" << newThemeName << m_colorScheme;
|
||||
+ qCDebug(lcQGtk3Interface) << "GTK theme changed to:" << newThemeName << newColorScheme;
|
||||
}
|
||||
+ m_colorScheme = newColorScheme;
|
||||
m_themeName = newThemeName;
|
||||
|
||||
// create standard mapping or load from Json file?
|
||||
diff --git a/src/plugins/platformthemes/gtk3/qgtk3storage_p.h b/src/plugins/platformthemes/gtk3/qgtk3storage_p.h
|
||||
index 37c5bf5..4519226 100644
|
||||
--- a/src/plugins/platformthemes/gtk3/qgtk3storage_p.h
|
||||
+++ b/src/plugins/platformthemes/gtk3/qgtk3storage_p.h
|
||||
@@ -16,6 +16,9 @@
|
||||
//
|
||||
|
||||
#include "qgtk3interface_p.h"
|
||||
+#if QT_CONFIG(dbus)
|
||||
+#include "qgtk3portalinterface_p.h"
|
||||
+#endif
|
||||
|
||||
#include <QtCore/QJsonDocument>
|
||||
#include <QtCore/QCache>
|
||||
@@ -205,7 +208,9 @@
|
||||
PaletteMap m_palettes;
|
||||
|
||||
std::unique_ptr<QGtk3Interface> m_interface;
|
||||
-
|
||||
+#if QT_CONFIG(dbus)
|
||||
+ std::unique_ptr<QGtk3PortalInterface> m_portalInterface;
|
||||
+#endif
|
||||
|
||||
Qt::ColorScheme m_colorScheme = Qt::ColorScheme::Unknown;
|
||||
|
@ -0,0 +1,13 @@
|
||||
diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake
|
||||
index 6a62b85c..1fc1f88d 100644
|
||||
--- a/cmake/QtFlagHandlingHelpers.cmake
|
||||
+++ b/cmake/QtFlagHandlingHelpers.cmake
|
||||
@@ -71,7 +71,7 @@ function(qt_internal_add_linker_version_script target)
|
||||
|
||||
string(APPEND contents "\n};\nQt_${PROJECT_VERSION_MAJOR}")
|
||||
if(QT_FEATURE_elf_private_full_version)
|
||||
- string(APPEND contents ".${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
||||
+ string(APPEND contents ".${PROJECT_VERSION_MINOR}")
|
||||
endif()
|
||||
string(APPEND contents "_PRIVATE_API { qt_private_api_tag*;\n")
|
||||
if(arg_PRIVATE_HEADERS)
|
@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# An attempt at providing a qmake wrapper for projects that
|
||||
# lack native qmake support (ie, qmake is run by buildsystem
|
||||
# instead of developer or fedora packager).
|
||||
|
||||
QMAKE="$(rpm --eval %{_qt6_qmake})"
|
||||
QMAKE_FLAGS="$(rpm --eval %{?_qt6_qmake_flags})"
|
||||
|
||||
eval $QMAKE $QMAKE_FLAGS $@
|
@ -1,85 +0,0 @@
|
||||
diff --git a/src/gui/text/unix/qfontconfigdatabase.cpp b/src/gui/text/unix/qfontconfigdatabase.cpp
|
||||
index 474644b8..f61e6e83 100644
|
||||
--- a/src/gui/text/unix/qfontconfigdatabase.cpp
|
||||
+++ b/src/gui/text/unix/qfontconfigdatabase.cpp
|
||||
@@ -592,6 +592,7 @@ void QFontconfigDatabase::populateFontDatabase()
|
||||
++f;
|
||||
}
|
||||
|
||||
+ cacheEmojiFontFamily();
|
||||
//QPA has very lazy population of the font db. We want it to be initialized when
|
||||
//QApplication is constructed, so that the population procedure can do something like this to
|
||||
//set the default font
|
||||
@@ -735,6 +736,9 @@ QStringList QFontconfigDatabase::fallbacksForFamily(const QString &family, QFont
|
||||
if (!pattern)
|
||||
return fallbackFamilies;
|
||||
|
||||
+ if (!m_cacheEmojiFontFamily.isEmpty())
|
||||
+ fallbackFamilies << m_cacheEmojiFontFamily;
|
||||
+
|
||||
FcValue value;
|
||||
value.type = FcTypeString;
|
||||
const QByteArray cs = family.toUtf8();
|
||||
@@ -1016,4 +1020,47 @@ void QFontconfigDatabase::setupFontEngine(QFontEngineFT *engine, const QFontDef
|
||||
engine->glyphFormat = format;
|
||||
}
|
||||
|
||||
+void QFontconfigDatabase::cacheEmojiFontFamily()
|
||||
+{
|
||||
+ FcPattern *pattern;
|
||||
+ pattern = FcPatternCreate();
|
||||
+
|
||||
+ FcValue value;
|
||||
+ value.type = FcTypeString;
|
||||
+ value.u.s = (const FcChar8 *)"emoji";
|
||||
+ FcPatternAdd(pattern,FC_FAMILY,value,true);
|
||||
+
|
||||
+ FcLangSet *ls = FcLangSetCreate();
|
||||
+ FcLangSetAdd(ls, (const FcChar8*)"und-zsye");
|
||||
+ FcPatternAddLangSet(pattern, FC_LANG, ls);
|
||||
+
|
||||
+ FcConfigSubstitute(nullptr, pattern, FcMatchPattern);
|
||||
+ FcDefaultSubstitute(pattern);
|
||||
+
|
||||
+ FcResult result = FcResultMatch;
|
||||
+ FcFontSet *fontSet = FcFontSort(nullptr,pattern,FcTrue,nullptr,&result);
|
||||
+ FcPatternDestroy(pattern);
|
||||
+
|
||||
+ if (fontSet) {
|
||||
+ for (int i = 0; i < fontSet->nfont; i++) {
|
||||
+ FcChar8 *value = nullptr;
|
||||
+ if (FcPatternGetString(fontSet->fonts[i], FC_FAMILY, 0, &value) != FcResultMatch)
|
||||
+ continue;
|
||||
+
|
||||
+ FcLangSet *rls = nullptr;
|
||||
+ if (FcPatternGetLangSet(fontSet->fonts[i], FC_LANG, 0, &rls) != FcResultMatch)
|
||||
+ continue;
|
||||
+
|
||||
+ if (!FcLangSetContains(rls, ls))
|
||||
+ continue;
|
||||
+
|
||||
+ m_cacheEmojiFontFamily = QString::fromUtf8((const char *)value);
|
||||
+ break;
|
||||
+ }
|
||||
+ FcFontSetDestroy(fontSet);
|
||||
+ }
|
||||
+
|
||||
+ FcLangSetDestroy(ls);
|
||||
+}
|
||||
+
|
||||
QT_END_NAMESPACE
|
||||
diff --git a/src/gui/text/unix/qfontconfigdatabase_p.h b/src/gui/text/unix/qfontconfigdatabase_p.h
|
||||
index cf15306e..90b94087 100644
|
||||
--- a/src/gui/text/unix/qfontconfigdatabase_p.h
|
||||
+++ b/src/gui/text/unix/qfontconfigdatabase_p.h
|
||||
@@ -37,7 +37,10 @@ public:
|
||||
QFont defaultFont() const override;
|
||||
|
||||
private:
|
||||
+ void cacheEmojiFontFamily();
|
||||
void setupFontEngine(QFontEngineFT *engine, const QFontDef &fontDef) const;
|
||||
+
|
||||
+ QString m_cacheEmojiFontFamily;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
@ -1,32 +0,0 @@
|
||||
diff --git a/cmake/FindInterbase.cmake b/cmake/FindInterbase.cmake
|
||||
index 22f866d8..4ef16e75 100644
|
||||
--- a/cmake/FindInterbase.cmake
|
||||
+++ b/cmake/FindInterbase.cmake
|
||||
@@ -19,12 +19,12 @@
|
||||
# The Interbase client library
|
||||
|
||||
find_path(Interbase_INCLUDE_DIR
|
||||
- NAMES ibase.h
|
||||
+ NAMES firebird/ibase.h
|
||||
HINTS ${Interbase_INCLUDEDIR}
|
||||
)
|
||||
|
||||
find_library(Interbase_LIBRARY
|
||||
- NAMES firebase_ms fbclient gds
|
||||
+ NAMES firebase_ms fbclient gds fbclient
|
||||
HINTS ${Interbase_LIBDIR}
|
||||
)
|
||||
|
||||
diff --git a/src/plugins/sqldrivers/ibase/qsql_ibase_p.h b/src/plugins/sqldrivers/ibase/qsql_ibase_p.h
|
||||
index 9109c2b4..7477d5ee 100644
|
||||
--- a/src/plugins/sqldrivers/ibase/qsql_ibase_p.h
|
||||
+++ b/src/plugins/sqldrivers/ibase/qsql_ibase_p.h
|
||||
@@ -52,7 +52,7 @@
|
||||
//
|
||||
|
||||
#include <QtSql/qsqldriver.h>
|
||||
-#include <ibase.h>
|
||||
+#include <firebird/ibase.h>
|
||||
|
||||
#ifdef QT_PLUGIN
|
||||
#define Q_EXPORT_SQLDRIVER_IBASE
|
@ -1,33 +0,0 @@
|
||||
diff -r -u a/mkspecs/linux-g++/qmake.conf b/mkspecs/linux-g++/qmake.conf
|
||||
--- a/mkspecs/linux-g++/qmake.conf 2015-10-30 06:20:01.000000000 -0200
|
||||
+++ b/mkspecs/linux-g++/qmake.conf 2015-11-05 11:23:23.230741601 -0200
|
||||
@@ -5,6 +5,7 @@
|
||||
MAKEFILE_GENERATOR = UNIX
|
||||
CONFIG += incremental
|
||||
QMAKE_INCREMENTAL_STYLE = sublib
|
||||
+QMAKE_CFLAGS_RELEASE += -O2
|
||||
|
||||
include(../common/linux.conf)
|
||||
include(../common/gcc-base-unix.conf)
|
||||
diff -r -u a/mkspecs/linux-g++-32/qmake.conf b/mkspecs/linux-g++-32/qmake.conf
|
||||
--- a/mkspecs/linux-g++-32/qmake.conf 2015-10-30 06:20:01.000000000 -0200
|
||||
+++ b/mkspecs/linux-g++-32/qmake.conf 2015-11-05 11:22:19.761494470 -0200
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
QMAKE_CFLAGS = -m32
|
||||
QMAKE_LFLAGS = -m32
|
||||
+QMAKE_CFLAGS_RELEASE += -O2
|
||||
|
||||
include(../common/gcc-base-unix.conf)
|
||||
include(../common/g++-unix.conf)
|
||||
diff -r -u a/mkspecs/linux-g++-64/qmake.conf b/mkspecs/linux-g++-64/qmake.conf
|
||||
--- a/mkspecs/linux-g++-64/qmake.conf 2015-10-30 06:20:01.000000000 -0200
|
||||
+++ b/mkspecs/linux-g++-64/qmake.conf 2015-11-05 11:22:49.497610248 -0200
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
QMAKE_CFLAGS = -m64
|
||||
QMAKE_LFLAGS = -m64
|
||||
+QMAKE_CFLAGS_RELEASE += -O2
|
||||
|
||||
include(../common/gcc-base-unix.conf)
|
||||
include(../common/g++-unix.conf)
|
@ -1,28 +0,0 @@
|
||||
From 25e78cce15fdf737cc48ed5d7683ad1d01b55621 Mon Sep 17 00:00:00 2001
|
||||
From: Christophe Giboudeaux <christophe@krop.fr>
|
||||
Date: Sun, 20 Sep 2020 09:57:22 +0200
|
||||
Subject: [PATCH] Tell the truth about private API
|
||||
|
||||
Mark private API with symbols only for the current patch release
|
||||
|
||||
This change is a port of the libqt5-qtbase patch which was
|
||||
added during the Qt 5.6 cycle.
|
||||
---
|
||||
cmake/QtFlagHandlingHelpers.cmake | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake
|
||||
index d8597326cc..f9da7b2171 100644
|
||||
--- a/cmake/QtFlagHandlingHelpers.cmake
|
||||
+++ b/cmake/QtFlagHandlingHelpers.cmake
|
||||
@@ -23,7 +23,7 @@ function(qt_internal_add_linker_version_script target)
|
||||
endif()
|
||||
|
||||
if(TEST_ld_version_script)
|
||||
- set(contents "Qt_${PROJECT_VERSION_MAJOR}_PRIVATE_API {\n qt_private_api_tag*;\n")
|
||||
+ set(contents "Qt_${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}_PRIVATE_API {\n qt_private_api_tag*;\n")
|
||||
if(arg_PRIVATE_HEADERS)
|
||||
foreach(ph ${arg_PRIVATE_HEADERS})
|
||||
string(APPEND contents " @FILE:${ph}@\n")
|
||||
--
|
||||
2.40.0
|
@ -1,12 +0,0 @@
|
||||
diff --git a/src/gui/platform/unix/qgenericunixthemes.cpp b/src/gui/platform/unix/qgenericunixthemes.cpp
|
||||
index 1efd759b..d0129f73 100644
|
||||
--- a/src/gui/platform/unix/qgenericunixthemes.cpp
|
||||
+++ b/src/gui/platform/unix/qgenericunixthemes.cpp
|
||||
@@ -977,6 +977,7 @@ QStringList QGenericUnixTheme::themeNames()
|
||||
result.push_back(QLatin1StringView(QKdeTheme::name));
|
||||
#endif
|
||||
} else if (gtkBasedEnvironments.contains(desktopName)) {
|
||||
+ result.push_back(QStringLiteral("qgnomeplatform"));
|
||||
// prefer the GTK3 theme implementation with native dialogs etc.
|
||||
result.push_back(QStringLiteral("gtk3"));
|
||||
// fallback to the generic Gnome theme if loading the GTK3 theme fails
|
Loading…
Reference in new issue