summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-04-03 01:01:00 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2020-04-03 15:12:48 +0200
commit7672e09770b9dffd56e81cdc531dba0b309425c5 (patch)
tree343cbfc1ca2de9eb5638fd4932263101341eb720 /src
parentab4c22d47d196d5eb28fc16cd7262c77bcb6875f (diff)
parent86d9e36b06b0347e1b7bd1b7f90618eab515dfaf (diff)
Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp4
-rw-r--r--src/angle/patches/0018-ANGLE-d3d11-Do-not-register-windows-message-hooks-fo.patch45
-rw-r--r--src/corelib/time/qtimezoneprivate_tz.cpp33
3 files changed, 60 insertions, 22 deletions
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp
index 5394e3d3e7..f5e6c93813 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp
@@ -168,7 +168,7 @@ HRESULT NativeWindow11Win32::createSwapChain(ID3D11Device *device,
nullptr, nullptr, &swapChain1);
if (SUCCEEDED(result))
{
- factory2->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_ALT_ENTER);
+ factory2->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_WINDOW_CHANGES);
*swapChain = static_cast<IDXGISwapChain *>(swapChain1);
}
SafeRelease(factory2);
@@ -196,7 +196,7 @@ HRESULT NativeWindow11Win32::createSwapChain(ID3D11Device *device,
HRESULT result = factory->CreateSwapChain(device, &swapChainDesc, swapChain);
if (SUCCEEDED(result))
{
- factory->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_ALT_ENTER);
+ factory->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_WINDOW_CHANGES);
}
return result;
}
diff --git a/src/angle/patches/0018-ANGLE-d3d11-Do-not-register-windows-message-hooks-fo.patch b/src/angle/patches/0018-ANGLE-d3d11-Do-not-register-windows-message-hooks-fo.patch
new file mode 100644
index 0000000000..03529c6531
--- /dev/null
+++ b/src/angle/patches/0018-ANGLE-d3d11-Do-not-register-windows-message-hooks-fo.patch
@@ -0,0 +1,45 @@
+From 3d23de2ad72968d0bf43dac4a9a0f237cc9e03e2 Mon Sep 17 00:00:00 2001
+From: Oliver Wolff <oliver.wolff@qt.io>
+Date: Wed, 1 Apr 2020 14:48:48 +0200
+Subject: [PATCH] ANGLE: d3d11: Do not register windows message hooks for d3d11
+ windows
+
+These message hooks are used to handle ALT+ENTER to enter/exit fullscreen
+mode and PRINTSCREEN to take screenshots. Qt is implementing these
+functionalities itself so we do not have to register these hooks.
+
+If too many of these hooks are registered, callbacks are no longer called
+and Qt's message queue is no longer handling messages. By saving these
+hooks we can make sure that more Qt windows at the same time are possible
+without getting unresponsive due to too many hooks being registered.
+
+Change-Id: I5354f91f08cbfeda5e8dc3ad7f824fbd5b3b2932
+---
+ .../src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp
+index 5394e3d..f5e6c93 100644
+--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp
++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp
+@@ -168,7 +168,7 @@ HRESULT NativeWindow11Win32::createSwapChain(ID3D11Device *device,
+ nullptr, nullptr, &swapChain1);
+ if (SUCCEEDED(result))
+ {
+- factory2->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_ALT_ENTER);
++ factory2->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_WINDOW_CHANGES);
+ *swapChain = static_cast<IDXGISwapChain *>(swapChain1);
+ }
+ SafeRelease(factory2);
+@@ -196,7 +196,7 @@ HRESULT NativeWindow11Win32::createSwapChain(ID3D11Device *device,
+ HRESULT result = factory->CreateSwapChain(device, &swapChainDesc, swapChain);
+ if (SUCCEEDED(result))
+ {
+- factory->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_ALT_ENTER);
++ factory->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_WINDOW_CHANGES);
+ }
+ return result;
+ }
+--
+2.7.4.windows.1
+
diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp
index c451f95a0e..09a04767bf 100644
--- a/src/corelib/time/qtimezoneprivate_tz.cpp
+++ b/src/corelib/time/qtimezoneprivate_tz.cpp
@@ -1123,15 +1123,15 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
{
// Check TZ env var first, if not populated try find it
QByteArray ianaId = qgetenv("TZ");
- if (!ianaId.isEmpty() && ianaId.at(0) == ':')
- ianaId = ianaId.mid(1);
// The TZ value can be ":/etc/localtime" which libc considers
// to be a "default timezone", in which case it will be read
// by one of the blocks below, so unset it here so it is not
// considered as a valid/found ianaId
- if (ianaId == "/etc/localtime")
+ if (ianaId == ":/etc/localtime")
ianaId.clear();
+ else if (ianaId.startsWith(':'))
+ ianaId = ianaId.mid(1);
// On most distros /etc/localtime is a symlink to a real file so extract name from the path
if (ianaId.isEmpty()) {
@@ -1150,15 +1150,12 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
}
}
- // On Debian Etch up to Jessie, /etc/localtime is a regular file while the actual name is in /etc/timezone
+ // On Debian Etch up to Jessie, /etc/localtime is a copy of the relevant
+ // zoneinfo file, whose name is recorded in /etc/timezone:
if (ianaId.isEmpty()) {
QFile tzif(QStringLiteral("/etc/timezone"));
- if (tzif.open(QIODevice::ReadOnly)) {
- // TODO QTextStream inefficient, replace later
- QTextStream ts(&tzif);
- if (!ts.atEnd())
- ianaId = ts.readLine().toUtf8();
- }
+ if (tzif.open(QIODevice::ReadOnly))
+ ianaId = tzif.readAll().trimmed();
}
// On some Red Hat distros /etc/localtime is real file with name held in /etc/sysconfig/clock
@@ -1166,16 +1163,12 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
if (ianaId.isEmpty()) {
QFile tzif(QStringLiteral("/etc/sysconfig/clock"));
if (tzif.open(QIODevice::ReadOnly)) {
- // TODO QTextStream inefficient, replace later
- QTextStream ts(&tzif);
- QString line;
- while (ianaId.isEmpty() && !ts.atEnd() && ts.status() == QTextStream::Ok) {
- line = ts.readLine();
- if (line.startsWith(QLatin1String("ZONE="))) {
- ianaId = line.midRef(6, line.size() - 7).toUtf8();
- } else if (line.startsWith(QLatin1String("TIMEZONE="))) {
- ianaId = line.midRef(10, line.size() - 11).toUtf8();
- }
+ while (ianaId.isEmpty() && !tzif.atEnd()) {
+ const QByteArray line(tzif.readLine().trimmed());
+ if (line.startsWith("ZONE="))
+ ianaId = line.mid(6, line.length() - 7);
+ else if (line.startsWith("TIMEZONE="))
+ ianaId = line.mid(10, line.length() - 11);
}
}
}