summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-11-16 20:59:58 +0000
committerMichael Meeks <michael.meeks@collabora.com>2015-11-17 09:20:58 +0000
commiteca4c54e52363f80db26e228e586aeb7732c7100 (patch)
treef96c872d02d15044279c5c49097aa8ea70a8f967 /vcl/unx/gtk
parent2ee802245ed9614734506a9d46edcbcee53ea2cc (diff)
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 <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/unx/gtk')
-rw-r--r--vcl/unx/gtk/gtkdata.cxx8
-rw-r--r--vcl/unx/gtk/gtkinst.cxx4
2 files changed, 8 insertions, 4 deletions
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()