Gentoo Archives: gentoo-commits

From: "Andreas HAttel (dilfridge)" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-office/libreoffice/files: libreoffice-4.1.3.2-kde-calchang.patch
Date: Sat, 07 Dec 2013 21:03:26
Message-Id: 20131207210318.41EF520005@flycatcher.gentoo.org
1 dilfridge 13/12/07 21:03:18
2
3 Added: libreoffice-4.1.3.2-kde-calchang.patch
4 Log:
5 Backport patch against KDE drag-n-drop hang from Git master, bug 489988. No testing yet, no keywords.
6
7 (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key EBE6A336BE19039C!)
8
9 Revision Changes Path
10 1.1 app-office/libreoffice/files/libreoffice-4.1.3.2-kde-calchang.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/libreoffice/files/libreoffice-4.1.3.2-kde-calchang.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/libreoffice/files/libreoffice-4.1.3.2-kde-calchang.patch?rev=1.1&content-type=text/plain
14
15 Index: libreoffice-4.1.3.2-kde-calchang.patch
16 ===================================================================
17 From 95f60222e75486336b6569afa8f34d60b51c94ad Mon Sep 17 00:00:00 2001
18 From: Jan-Marek Glogowski <glogow@×××××××.de>
19 Date: Thu, 21 Nov 2013 12:40:57 +0100
20 Subject: [PATCH] fdo#67011: Run Display::Yield through KDEXLib::Yield.
21
22 Drag'n'Drop is handled in a second thread, which tries to "yield
23 the display" while the main Qt thread probably is already
24 yielding. Both need the YieldMutex, which freezes the application
25 until the D'n'D thread times out.
26
27 Trying to yield the display throught the application yield
28 results in a recursive loop.
29
30 So this catches and breaks the recursion, but just inside the Qt
31 thread, so other processes can "yield on the display", instead
32 of simply disabling the Display::Yield.
33
34 Change-Id: Ifba91aa89fe5b0a89cc94820935dc996a065112f
35 Reviewed-on: https://gerrit.libreoffice.org/6750
36 Tested-by: Jan-Marek Glogowski <glogow@×××××××.de>
37 Reviewed-by: Jan-Marek Glogowski <glogow@×××××××.de>
38 ---
39 vcl/unx/kde4/KDESalDisplay.cxx | 22 ++++++++++++++++------
40 1 file changed, 16 insertions(+), 6 deletions(-)
41
42 diff --git a/vcl/unx/kde4/KDESalDisplay.cxx b/vcl/unx/kde4/KDESalDisplay.cxx
43 index 21440fc..ee330e7 100644
44 --- a/vcl/unx/kde4/KDESalDisplay.cxx
45 +++ b/vcl/unx/kde4/KDESalDisplay.cxx
46 @@ -25,6 +25,8 @@
47 #include <assert.h>
48 #include <unx/saldata.hxx>
49
50 +#include <qthread.h>
51 +
52 SalKDEDisplay* SalKDEDisplay::selfptr = NULL;
53
54 SalKDEDisplay::SalKDEDisplay( Display* pDisp )
55 @@ -48,18 +50,26 @@ SalKDEDisplay::~SalKDEDisplay()
56
57 void SalKDEDisplay::Yield()
58 {
59 - if( DispatchInternalEvent() )
60 + // We yield the display throught the main Qt thread.
61 + // Actually this Yield may call the Display::Yield, which results in an
62 + // unlimited cycle.
63 + static bool break_cyclic_yield_recursion = false;
64 + bool is_qt_gui_thread = ( qApp->thread() == QThread::currentThread() );
65 +
66 + if( DispatchInternalEvent() || break_cyclic_yield_recursion )
67 return;
68
69 + if( is_qt_gui_thread )
70 + break_cyclic_yield_recursion = true;
71 +
72 DBG_ASSERT( static_cast<SalYieldMutex*>(GetSalData()->m_pInstance->GetYieldMutex())->GetThreadId() ==
73 osl::Thread::getCurrentIdentifier(),
74 "will crash soon since solar mutex not locked in SalKDEDisplay::Yield" );
75
76 - XEvent event;
77 - XNextEvent( pDisp_, &event );
78 - if( checkDirectInputEvent( &event ))
79 - return;
80 - qApp->x11ProcessEvent( &event );
81 + static_cast<KDEXLib*>(GetXLib())->Yield( true, false );
82 +
83 + if( is_qt_gui_thread )
84 + break_cyclic_yield_recursion = false;
85 }
86
87 // HACK: When using Qt event loop, input methods (japanese, etc.) will get broken because
88 --
89 1.8.5.1