summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/gtkinst.cxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-07-13 14:57:21 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2017-07-13 15:07:41 +0200
commit9bc95521aaa35b533894b3934519acdbd7a47815 (patch)
treeddb735f40b3ab1cc2e24c40c4340ef9b875759a2 /vcl/unx/gtk/gtkinst.cxx
parent3319e2975c0b08595b64111c8340c5cd9ef193d5 (diff)
Revert "GTK+ simplifiy system timer implementation"
Current LO baseline doesn't have g_source_get_ready_time, so we keep the old stuff. This reverts commit 3e20ce802ee2ab49c4f2a98880f6e999657686bb. Change-Id: I32c39fa70c8d52cbb78620f528d60a986087dfd0
Diffstat (limited to 'vcl/unx/gtk/gtkinst.cxx')
-rw-r--r--vcl/unx/gtk/gtkinst.cxx25
1 files changed, 16 insertions, 9 deletions
diff --git a/vcl/unx/gtk/gtkinst.cxx b/vcl/unx/gtk/gtkinst.cxx
index caaa2af2499f..034b634a0f79 100644
--- a/vcl/unx/gtk/gtkinst.cxx
+++ b/vcl/unx/gtk/gtkinst.cxx
@@ -156,7 +156,6 @@ GtkInstance::GtkInstance( SalYieldMutex* pMutex )
#else
: X11SalInstance( pMutex )
#endif
- , m_pTimer(nullptr)
, bNeedsInit(true)
, m_pLastCairoFontOptions(nullptr)
{
@@ -195,7 +194,8 @@ void GtkInstance::EnsureInit()
GtkInstance::~GtkInstance()
{
- assert( nullptr == m_pTimer );
+ while( !m_aTimers.empty() )
+ delete *m_aTimers.begin();
DeInitAtkBridge();
ResetLastSeenCairoFontOptions();
}
@@ -397,16 +397,18 @@ void GtkInstance::DestroyMenuItem( SalMenuItem* ) {}
SalTimer* GtkInstance::CreateSalTimer()
{
EnsureInit();
- assert( nullptr == m_pTimer );
- if ( nullptr == m_pTimer )
- m_pTimer = new GtkSalTimer();
- return m_pTimer;
+ GtkSalTimer *pTimer = new GtkSalTimer();
+ m_aTimers.push_back( pTimer );
+ return pTimer;
}
-void GtkInstance::RemoveTimer()
+void GtkInstance::RemoveTimer (SalTimer *pTimer)
{
EnsureInit();
- m_pTimer = nullptr;
+ std::vector<GtkSalTimer *>::iterator it;
+ it = std::find( m_aTimers.begin(), m_aTimers.end(), pTimer );
+ if( it != m_aTimers.end() )
+ m_aTimers.erase( it );
}
bool GtkInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong const nReleased)
@@ -420,7 +422,12 @@ bool GtkInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong co
bool GtkInstance::IsTimerExpired()
{
EnsureInit();
- return (m_pTimer && m_pTimer->Expired());
+ for( std::vector<GtkSalTimer *>::iterator it = m_aTimers.begin();
+ it != m_aTimers.end(); ++it )
+ if( (*it)->Expired() )
+ return true;
+
+ return false;
}
bool GtkInstance::AnyInput( VclInputFlags nType )