Hrvoje Senjan 2014-07-01 22:25:13 +00:00 committed by Git OBS Bridge
parent 7cad7e8a3f
commit 739abbeb55
5 changed files with 18 additions and 125 deletions

View File

@ -1,116 +0,0 @@
From 6210b6bb8af128c8e93c77330af80185d8ac3bec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= <mgraesslin@kde.org>
Date: Wed, 21 May 2014 08:10:07 +0200
Subject: [PATCH 1/1] Ensure the xcb connection gets flushed before the event
dispatcher blocks
This is a workaround for Qt versions which do not yet have the change
https://codereview.qt-project.org/85654
It is important to have this workaround as applications can get stalled
when a framework uses xcb and doesn't flush the connection manually.
BUG: 334858
REVIEW: 118234
---
src/platformtheme/CMakeLists.txt | 19 +++++++++++++++
src/platformtheme/config-platformtheme.h.cmake | 1 +
src/platformtheme/main.cpp | 33 ++++++++++++++++++++++++++
3 files changed, 53 insertions(+)
create mode 100644 src/platformtheme/config-platformtheme.h.cmake
diff --git a/src/platformtheme/CMakeLists.txt b/src/platformtheme/CMakeLists.txt
index da77cf8..8a3b1b4 100644
--- a/src/platformtheme/CMakeLists.txt
+++ b/src/platformtheme/CMakeLists.txt
@@ -1,3 +1,18 @@
+if(NOT APPLE)
+ find_package(XCB COMPONENTS XCB)
+ set_package_properties(XCB PROPERTIES
+ TYPE RECOMMENDED
+ PURPOSE "Required for flushing the XCB connection on the X11 Platform"
+ )
+ set(HAVE_X11 ${XCB_XCB_FOUND})
+ if (XCB_XCB_FOUND)
+ find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED X11Extras)
+ endif()
+else()
+ set(HAVE_X11 FALSE)
+endif()
+
+configure_file(config-platformtheme.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-platformtheme.h )
set(platformtheme_SRCS
kdeplatformtheme.cpp
@@ -30,4 +45,8 @@ target_link_libraries(KDEPlatformTheme
KF5::Notifications
)
+if(HAVE_X11)
+ target_link_libraries(KDEPlatformTheme PRIVATE Qt5::X11Extras XCB::XCB)
+endif()
+
install(TARGETS KDEPlatformTheme DESTINATION ${QT_PLUGIN_INSTALL_DIR}/platformthemes)
diff --git a/src/platformtheme/config-platformtheme.h.cmake b/src/platformtheme/config-platformtheme.h.cmake
new file mode 100644
index 0000000..89858d1
--- /dev/null
+++ b/src/platformtheme/config-platformtheme.h.cmake
@@ -0,0 +1 @@
+#cmakedefine01 HAVE_X11
diff --git a/src/platformtheme/main.cpp b/src/platformtheme/main.cpp
index 21d9aa0..d2c2bb1 100644
--- a/src/platformtheme/main.cpp
+++ b/src/platformtheme/main.cpp
@@ -22,6 +22,14 @@
#include "kdeplatformtheme.h"
+#include <config-platformtheme.h>
+#if HAVE_X11
+#include <QCoreApplication>
+#include <QAbstractEventDispatcher>
+#include <QX11Info>
+#include <xcb/xcb.h>
+#endif
+
class KdePlatformThemePlugin : public QPlatformThemePlugin
{
Q_OBJECT
@@ -34,8 +42,33 @@ public:
{
Q_UNUSED(key)
Q_UNUSED(paramList)
+ // Must be done after we have an event-dispatcher. By posting a method invocation
+ // we are sure that by the time the method is called we have an event-dispatcher.
+ QMetaObject::invokeMethod(this, "setupXcbFlush", Qt::QueuedConnection);
return new KdePlatformTheme;
}
+
+public Q_SLOTS:
+ void setupXcbFlush();
};
+void KdePlatformThemePlugin::setupXcbFlush()
+{
+#if HAVE_X11
+ // this is a workaround for BUG 334858
+ // it ensures that the xcb connection gets flushed before the EventDispatcher
+ // is going to block. Qt does not guarantee this in all cases.
+ // For Qt this issue is addressed in https://codereview.qt-project.org/85654
+ // TODO: remove again once we depend on a Qt version with the patch.
+ if (!QX11Info::isPlatformX11()) {
+ return;
+ }
+ connect(QCoreApplication::eventDispatcher(), &QAbstractEventDispatcher::aboutToBlock,
+ []() {
+ xcb_flush(QX11Info::connection());
+ }
+ );
+#endif
+}
+
#include "main.moc"
--
1.9.3

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:08f1b4d6804386cda52ce51635cf0e270033f39a24ac1df04287c267dad90391
size 1756348

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:72f17df825491fe3b4a9143bfee2ccedfa607f9db77ea8dcfa248f3fe7171985
size 1756592

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Tue Jul 1 21:35:49 UTC 2014 - hrvoje.senjan@gmail.com
- Update to 5.0.0
* Final release of KDE Frameworks 5
* API improvements and cleanups
* Buildsystem fixes
* For more details please see:
http://www.kde.org/announcements/announce-frameworks5-5.0.0.php
- Drop 0001-Ensure-the-xcb-connection-gets-flushed-before-the-ev.patch,
merged upstream
-------------------------------------------------------------------
Sun Jun 1 18:02:20 UTC 2014 - hrvoje.senjan@gmail.com

View File

@ -18,10 +18,10 @@
%define lname libKF5Style5
Name: frameworkintegration
Version: 4.100.0
Version: 5.0.0
Release: 0
BuildRequires: cmake >= 2.8.12
BuildRequires: extra-cmake-modules >= 0.0.14
BuildRequires: extra-cmake-modules >= 1.0.0
BuildRequires: fdupes
BuildRequires: kconfig-devel >= %{_kf5_version}
BuildRequires: kconfigwidgets-devel >= %{_kf5_version}
@ -41,10 +41,8 @@ Summary: Plugins responsible for better integration of Qt applications in
License: LGPL-2.1+
Group: System/GUI/KDE
Url: http://www.kde.org
Source: http://download.kde.org/unstable/frameworks/%{version}/%{name}-%{version}.tar.xz
Source: http://download.kde.org/stable/frameworks/%{version}/%{name}-%{version}.tar.xz
Source1: baselibs.conf
# PATCH-FIX-UPSTREAM 0001-Ensure-the-xcb-connection-gets-flushed-before-the-ev.patch -- kde#334858
Patch0: 0001-Ensure-the-xcb-connection-gets-flushed-before-the-ev.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -85,7 +83,6 @@ Applications do not need to link to this directly. Development files
%lang_package -n %lname
%prep
%setup -q
%patch0 -p1
%build
%cmake_kf5 -d build