Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libqt5-qtbase for openSUSE:Factory 
checked in at 2021-01-20 18:23:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libqt5-qtbase (Old)
 and      /work/SRC/openSUSE:Factory/.libqt5-qtbase.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libqt5-qtbase"

Wed Jan 20 18:23:27 2021 rev:116 rq:864292 version:5.15.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/libqt5-qtbase/libqt5-qtbase.changes      
2020-12-30 17:12:30.204777967 +0100
+++ /work/SRC/openSUSE:Factory/.libqt5-qtbase.new.28504/libqt5-qtbase.changes   
2021-01-20 18:23:39.175318849 +0100
@@ -1,0 +2,7 @@
+Tue Jan 19 07:46:43 UTC 2021 - Stefan Br??ns <stefan.bru...@rwth-aachen.de>
+
+- Add patch to fix infinite loop in KWin on XServer exit:
+  * 0001-Let-QXcbConnection-getTimestamp-properly-exit-when-X.patch
+- Spec file cleanup, remove conditionals for Leap 42.x
+
+-------------------------------------------------------------------

New:
----
  0001-Let-QXcbConnection-getTimestamp-properly-exit-when-X.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libqt5-qtbase.spec ++++++
--- /var/tmp/diff_new_pack.uShFSt/_old  2021-01-20 18:23:40.811320059 +0100
+++ /var/tmp/diff_new_pack.uShFSt/_new  2021-01-20 18:23:40.815320062 +0100
@@ -25,15 +25,8 @@
 %global gles 0
 %endif
 
-%if 0%{?suse_version} >= 1330
 %global vulkan 1
 %bcond_without harfbuzz
-%else
-# Harfbuzz too old
-%bcond_with harfbuzz
-# Vulkan headers too old
-%global vulkan 0
-%endif
 
 Name:           libqt5-qtbase
 Version:        5.15.2
@@ -72,6 +65,8 @@
 # patches 1000-2000 and above from upstream 5.15 branch #
 # Merged: https://bugreports.qt.io/browse/QTBUG-87010
 Patch1000:      0001-Fix-allocated-memory-of-QByteArray.patch
+# Merged: https://bugreports.qt.io/browse/QTBUG-88435
+Patch1001:      0001-Let-QXcbConnection-getTimestamp-properly-exit-when-X.patch
 # patches 2000-3000 and above from upstream qt6/dev branch #
 # Not accepted yet, https://codereview.qt-project.org/c/qt/qtbase/+/255384
 Patch2001:      0002-Synthesize-Enter-LeaveEvent-for-accepted-QTabletEven.patch

++++++ 0001-Let-QXcbConnection-getTimestamp-properly-exit-when-X.patch ++++++
>From 5519447b9db4023deca98e5b882845416a9c33f1 Mon Sep 17 00:00:00 2001
From: Sheng Mao <shng...@gmail.com>
Date: Fri, 13 Nov 2020 22:34:46 -0700
Subject: [PATCH] Let QXcbConnection::getTimestamp properly exit when X server
 quits
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

QXcbConnection::getTimestamp uses dummy events to get timestamp from
X server. However, in some cases, X server shuts down while client tries
to get timestamp. In this case, QXcbConnection::getTimestamp keeps
getting null event and thus falls into indefinite loop.

This fix checks if xcb connection is still valid and use a special
xcb_timestamp_t value, CurrentTime (0L), as returned value.
CurrentTime should not be generated by X server and if getTimestamp
returns this value, it means an "exception" case is triggered.

This fix is introduced because in kwin_x11 (KDE project), X server can
exit on logout. kwin_x11 should handle disconnection from X server.
But the indefinite loop prevents kwin_x11 to process disconnection
event and therefore kwin_x11 cannot quit properly.

Fixes: QTBUG-88435
Change-Id: Iaf7ef3f8a35fa8389d22a608e3c49041bf90e1b9
Reviewed-by: Qt CI Bot <qt_ci_...@qt-project.org>
Reviewed-by: Liang Qi <liang...@qt.io>
Reviewed-by: Tor Arne Vestb?? <tor.arne.ves...@qt.io>
(cherry picked from commit dbd1c8b047700bb6d0adae848d6cbb89fa2fcfff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_...@qt-project.org>
---
 src/plugins/platforms/xcb/qxcbconnection.cpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp 
b/src/plugins/platforms/xcb/qxcbconnection.cpp
index c557109bd1..9abdae6a7c 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -763,7 +763,10 @@ xcb_timestamp_t QXcbConnection::getTimestamp()
 
     xcb_generic_event_t *event = nullptr;
 
-    while (!event) {
+    // When disconnection is caused by X server, event will never be able to 
hold
+    // a valid pointer. isConnected(), which calls xcb_connection_has_error(),
+    // can handle this type of disconnection and properly quits the loop.
+    while (isConnected() && !event) {
         connection()->sync();
         event = eventQueue()->peek([window, dummyAtom](xcb_generic_event_t 
*event, int type) {
             if (type != XCB_PROPERTY_NOTIFY)
@@ -773,6 +776,14 @@ xcb_timestamp_t QXcbConnection::getTimestamp()
         });
     }
 
+    if (!event) {
+        // 
https://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html#glossary
+        // > One timestamp value (named CurrentTime) is never generated by the
+        // > server. This value is reserved for use in requests to represent 
the
+        // > current server time.
+        return XCB_CURRENT_TIME;
+    }
+
     xcb_property_notify_event_t *pn = 
reinterpret_cast<xcb_property_notify_event_t *>(event);
     xcb_timestamp_t timestamp = pn->time;
     free(event);
-- 
2.30.0

Reply via email to