public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in app-office/libreoffice/files: libreoffice-4.1.3.2-kde-calchang.patch
@ 2013-12-07 21:03 Andreas HAttel (dilfridge)
  0 siblings, 0 replies; only message in thread
From: Andreas HAttel (dilfridge) @ 2013-12-07 21:03 UTC (permalink / raw
  To: gentoo-commits

dilfridge    13/12/07 21:03:18

  Added:                libreoffice-4.1.3.2-kde-calchang.patch
  Log:
  Backport patch against KDE drag-n-drop hang from Git master, bug 489988. No testing yet, no keywords.
  
  (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key EBE6A336BE19039C!)

Revision  Changes    Path
1.1                  app-office/libreoffice/files/libreoffice-4.1.3.2-kde-calchang.patch

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
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

Index: libreoffice-4.1.3.2-kde-calchang.patch
===================================================================
From 95f60222e75486336b6569afa8f34d60b51c94ad Mon Sep 17 00:00:00 2001
From: Jan-Marek Glogowski <glogow@fbihome.de>
Date: Thu, 21 Nov 2013 12:40:57 +0100
Subject: [PATCH] fdo#67011: Run Display::Yield through KDEXLib::Yield.

Drag'n'Drop is handled in a second thread, which tries to "yield
the display" while the main Qt thread probably is already
yielding. Both need the YieldMutex, which freezes the application
until the D'n'D thread times out.

Trying to yield the display throught the application yield
results in a recursive loop.

So this catches and breaks the recursion, but just inside the Qt
thread, so other processes can "yield on the display", instead
of simply disabling the Display::Yield.

Change-Id: Ifba91aa89fe5b0a89cc94820935dc996a065112f
Reviewed-on: https://gerrit.libreoffice.org/6750
Tested-by: Jan-Marek Glogowski <glogow@fbihome.de>
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
---
 vcl/unx/kde4/KDESalDisplay.cxx | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/vcl/unx/kde4/KDESalDisplay.cxx b/vcl/unx/kde4/KDESalDisplay.cxx
index 21440fc..ee330e7 100644
--- a/vcl/unx/kde4/KDESalDisplay.cxx
+++ b/vcl/unx/kde4/KDESalDisplay.cxx
@@ -25,6 +25,8 @@
 #include <assert.h>
 #include <unx/saldata.hxx>
 
+#include <qthread.h>
+
 SalKDEDisplay* SalKDEDisplay::selfptr = NULL;
 
 SalKDEDisplay::SalKDEDisplay( Display* pDisp )
@@ -48,18 +50,26 @@ SalKDEDisplay::~SalKDEDisplay()
 
 void SalKDEDisplay::Yield()
 {
-    if( DispatchInternalEvent() )
+    // We yield the display throught the main Qt thread.
+    // Actually this Yield may call the Display::Yield, which results in an
+    // unlimited cycle.
+    static bool break_cyclic_yield_recursion = false;
+    bool is_qt_gui_thread = ( qApp->thread() == QThread::currentThread() );
+
+    if( DispatchInternalEvent() || break_cyclic_yield_recursion )
         return;
 
+    if( is_qt_gui_thread )
+        break_cyclic_yield_recursion = true;
+
     DBG_ASSERT( static_cast<SalYieldMutex*>(GetSalData()->m_pInstance->GetYieldMutex())->GetThreadId() ==
                 osl::Thread::getCurrentIdentifier(),
                 "will crash soon since solar mutex not locked in SalKDEDisplay::Yield" );
 
-    XEvent event;
-    XNextEvent( pDisp_, &event );
-    if( checkDirectInputEvent( &event ))
-        return;
-    qApp->x11ProcessEvent( &event );
+    static_cast<KDEXLib*>(GetXLib())->Yield( true, false );
+
+    if( is_qt_gui_thread )
+        break_cyclic_yield_recursion = false;
 }
 
 // HACK: When using Qt event loop, input methods (japanese, etc.) will get broken because
-- 
1.8.5.1






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-12-07 21:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-07 21:03 [gentoo-commits] gentoo-x86 commit in app-office/libreoffice/files: libreoffice-4.1.3.2-kde-calchang.patch Andreas HAttel (dilfridge)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox