From eca4c54e52363f80db26e228e586aeb7732c7100 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Mon, 16 Nov 2015 20:59:58 +0000 Subject: vcl: add parameter to detect if OS events are processed during Yield. Intended as a non-functional change. Change-Id: I1915aad03786540da1a4bfe9031d33f2c2a9b4e3 Reviewed-on: https://gerrit.libreoffice.org/20006 Tested-by: Jenkins Reviewed-by: Michael Meeks --- vcl/unx/gtk/gtkdata.cxx | 8 ++++++-- vcl/unx/gtk/gtkinst.cxx | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'vcl/unx/gtk') diff --git a/vcl/unx/gtk/gtkdata.cxx b/vcl/unx/gtk/gtkdata.cxx index 5fd4c0ecb5b3..02ad2b81468c 100644 --- a/vcl/unx/gtk/gtkdata.cxx +++ b/vcl/unx/gtk/gtkdata.cxx @@ -578,9 +578,11 @@ void GtkData::Dispose() deInitNWF(); } -void GtkData::Yield( bool bWait, bool bHandleAllCurrentEvents ) +/// Allows events to be processed, returns true if we processed an event. +bool GtkData::Yield( bool bWait, bool bHandleAllCurrentEvents ) { blockIdleTimeout = !bWait; + /* #i33212# only enter g_main_context_iteration in one thread at any one * time, else one of them potentially will never end as long as there is * another thread in there. Having only one yielding thread actually dispatch @@ -596,7 +598,7 @@ void GtkData::Yield( bool bWait, bool bHandleAllCurrentEvents ) else if( ! bWait ) { blockIdleTimeout = false; - return; // someone else is waiting already, return + return false; // someone else is waiting already, return } if( bDispatchThread ) @@ -630,6 +632,8 @@ void GtkData::Yield( bool bWait, bool bHandleAllCurrentEvents ) osl_setCondition( m_aDispatchCondition ); // trigger non dispatch thread yields } blockIdleTimeout = false; + + return bWasEvent; } void GtkData::Init() diff --git a/vcl/unx/gtk/gtkinst.cxx b/vcl/unx/gtk/gtkinst.cxx index eeb75de2c902..0e7ba5e7e0cd 100644 --- a/vcl/unx/gtk/gtkinst.cxx +++ b/vcl/unx/gtk/gtkinst.cxx @@ -396,12 +396,12 @@ void GtkInstance::RemoveTimer (SalTimer *pTimer) m_aTimers.erase( it ); } -void GtkInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong const nReleased) +bool GtkInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong const nReleased) { (void) nReleased; assert(nReleased == 0); // not implemented EnsureInit(); - GetGtkSalData()->Yield( bWait, bHandleAllCurrentEvents ); + return GetGtkSalData()->Yield( bWait, bHandleAllCurrentEvents ); } bool GtkInstance::IsTimerExpired() -- cgit