From ebffeee152ea7661fdb83cfc33e976edef24f314 Mon Sep 17 00:00:00 2001
From: obarun <eric@obarun.org>
Date: Wed, 3 Jul 2019 04:41:59 +0000
Subject: [PATCH] upgpkg: 5.13.0-8

---
 PKGBUILD               | 19 +++++++++++++++----
 virtualbox-focus.patch | 13 +++++++++++++
 2 files changed, 28 insertions(+), 4 deletions(-)
 create mode 100644 virtualbox-focus.patch

diff --git a/PKGBUILD b/PKGBUILD
index 02961bb..1243800 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -10,15 +10,18 @@
 
 pkgbase=qt5-base
 pkgname=(qt5-base qt5-xcb-private-headers)
-_qtver=5.12.4
+_qtver=5.13.0
 pkgver=${_qtver/-/}
-pkgrel=2
+pkgrel=8
 arch=('x86_64')
 url="https://www.qt.io"
 license=('GPL3' 'LGPL3' 'FDL' 'custom')
 pkgdesc="A cross-platform application and UI framework"
 _pkgfqn="${pkgbase/5-/}-everywhere-src-${_qtver}"
-source=("http://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz")
+source=("http://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz"
+		qtbase-qxcbwindow.patch::"https://code.qt.io/cgit/qt/qtbase.git/patch/?id=0c183117"
+		qtbase-zlib-compression.patch::"https://code.qt.io/cgit/qt/qtbase.git/patch/?id=cbdc9a77"
+		virtualbox-focus.patch)
 conflicts=(
 	'qtchooser')
 groups=(
@@ -77,6 +80,10 @@ prepare() {
 	  mkspecs/common/gcc-base.conf
 	sed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 ${LDFLAGS}|" \
 	  mkspecs/common/g++-unix.conf
+	 
+	patch -p1 -i ../qtbase-qxcbwindow.patch # Fix NVIDIA freeze
+	patch -p1 -i ../qtbase-zlib-compression.patch # Change the default compression back to zlib for backwards compatibility
+	patch -p1 -i ../virtualbox-focus.patch # Fix virtualbox constantly stealing focus https://bugreports.qt.io/browse/QTBUG-76742
 }
 
 build() {
@@ -102,6 +109,7 @@ build() {
 		-optimized-qmake \
 		-dbus-linked \
 		-system-harfbuzz \
+		-no-mimetype-database \
 		-no-use-gold-linker \
 		-reduce-relocations
 	make
@@ -143,4 +151,7 @@ package_qt5-xcb-private-headers() {
 }
 
 #--------------------------------------------------------------------------------------
-sha512sums=('28b029a0d3621477f625d474b8bc38ddcc7173df6adb274b438e290b6c50bd0891e5b62c04b566a281781acee3a353a6a3b0bc88228e996994f92900448d7946')
+sha512sums=('33b74cd6e8a7671b6f621ffee1e0d572ad52463eab1f041e11f769fe01706ce187601bfe93211cd00b0138a3ff9698d5138476de7c141d52f4ec330672709580'
+            '1174da76c8f2df71f8778b3ec6a5d5171b203f519652650ca099446207a53fd052b450c1ae944e70a963695f90e32a22ecb957a1738054c05eb731521247f28c'
+            '1785bfde1685cb4e8fc0128ac6e338761ec00d0f70a68b97ba176b01ab539178ac3746eb67eed3c2039c30f076475e2e87bc31fe2a9b7fce499e6324646cad31'
+            'af0c1101bf001a8ba566859eeed083dcde6dc8b32edb8eb0de6672045622167a462f2f16cb0f208fd46bfc1847c68d44fb0ec45a0b729436b40aafa08334c56c')
diff --git a/virtualbox-focus.patch b/virtualbox-focus.patch
new file mode 100644
index 0000000..cc19065
--- /dev/null
+++ b/virtualbox-focus.patch
@@ -0,0 +1,13 @@
+diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
+index 9382488b74..1bf1ab268d 100644
+--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
++++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
+@@ -848,7 +848,7 @@ void QXcbWindow::doFocusOut()
+     connection()->setFocusWindow(nullptr);
+     relayFocusToModalWindow();
+     // Do not set the active window to nullptr if there is a FocusIn coming.
+-    connection()->focusInTimer().start(400);
++    connection()->focusInTimer().start(100);
+ }
+ 
+ struct QtMotifWmHints {
-- 
GitLab