diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-10-09 15:26:53 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-10-09 19:39:27 +0200 |
commit | 6d7191a9bbbae1421edc7d94dccc040f622bc227 (patch) | |
tree | 634e368a7af071053373c8cd86fbf4de97fee955 /vcl | |
parent | a3a89fc81a47640d0cd63453f72717a8ddb3970d (diff) |
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@libreoffice.org>
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/salusereventlist.cxx | 28 |
1 files changed, 19 insertions, 9 deletions
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(); |