[Libreoffice-commits] core.git: vcl/source

Jan-Marek Glogowski glogow at fbihome.de
Mon Oct 9 17:39:53 UTC 2017


 vcl/source/app/salusereventlist.cxx |   28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

New commits:
commit 6d7191a9bbbae1421edc7d94dccc040f622bc227
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Mon Oct 9 15:26:53 2017 +0200

    tdf#112931 always signal AllUserEventsProcessed
    
    If the last user event triggers a nested event loop, there is
    no event in the nested loop, but AllUserEventsProcessed will
    not be signaled, resulting in a busy loop in the gtk backend.
    
    So just always signal AllUserEventsProcessed, if it was not
    yet signaled.
    
    While at it catch and std::abort on uncaught exceptions and fix
    the default to have been signaled, so we won't signal on an
    empty list on first run.
    
    Change-Id: I480da906d87d3b95ba30b4c18420d2e20ffb5b2e
    Reviewed-on: https://gerrit.libreoffice.org/43282
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/vcl/source/app/salusereventlist.cxx b/vcl/source/app/salusereventlist.cxx
index 8f9d76ed313f..52154ec8d2eb 100644
--- a/vcl/source/app/salusereventlist.cxx
+++ b/vcl/source/app/salusereventlist.cxx
@@ -23,7 +23,7 @@
 #include <algorithm>
 
 SalUserEventList::SalUserEventList()
-    : m_bAllUserEventProcessedSignaled( false )
+    : m_bAllUserEventProcessedSignaled( true )
 {
 }
 
@@ -78,16 +78,26 @@ bool SalUserEventList::DispatchUserEvents( bool bHandleAllCurrentEvents )
             }
 
             if ( isFrameAlive( aEvent.m_pFrame ) )
-                ProcessEvent( aEvent );
+            {
+                try
+                {
+                    ProcessEvent( aEvent );
+                }
+                catch (...)
+                {
+                    SAL_WARN( "vcl", "Uncaught exception during ProcessEvent!" );
+                    std::abort();
+                }
+            }
         }
         while( true );
+    }
 
-        osl::MutexGuard aGuard( m_aUserEventsMutex );
-        if ( !m_bAllUserEventProcessedSignaled && !HasUserEvents() )
-        {
-            m_bAllUserEventProcessedSignaled = true;
-            TriggerAllUserEventsProcessed();
-        }
+    osl::MutexGuard aGuard( m_aUserEventsMutex );
+    if ( !m_bAllUserEventProcessedSignaled && !HasUserEvents() )
+    {
+        m_bAllUserEventProcessedSignaled = true;
+        TriggerAllUserEventsProcessed();
     }
 
     return bWasEvent;
@@ -115,7 +125,7 @@ bool SalUserEventList::RemoveEvent( SalFrame* pFrame, void* pData, SalEvent nEve
         }
     }
 
-    if ( bResult && !m_bAllUserEventProcessedSignaled && !HasUserEvents() )
+    if ( !m_bAllUserEventProcessedSignaled && !HasUserEvents() )
     {
         m_bAllUserEventProcessedSignaled = true;
         TriggerAllUserEventsProcessed();


More information about the Libreoffice-commits mailing list