make sure that LOK "updated types" start a timer as well

273a25c796 changed the handling of LOK
messages to only set up an "updated" flag for types and then
when flushing the value is fetched. This means that queue() is not
called for such updates, and so the timeout to flush the messages
wasn't started.

Change-Id: I3a7324c86a55697f509f80b6c54cb949fb1daa72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130526
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
This commit is contained in:
Luboš Luňák
2022-02-25 14:41:25 +01:00
parent c6abf6449e
commit 6c49b42909
2 changed files with 14 additions and 6 deletions
+1
View File
@@ -177,6 +177,7 @@ namespace desktop {
typedef std::vector<int> queue_type1;
typedef std::vector<CallbackData> queue_type2;
void startTimer();
bool removeAll(int type);
bool removeAll(int type, const std::function<bool (const CallbackData&)>& rTestFunc);
bool processInvalidateTilesEvent(int type, CallbackData& aCallbackData);
+13 -6
View File
@@ -1392,6 +1392,8 @@ void CallbackFlushHandler::setUpdatedType( int nType, bool value )
if( m_updatedTypes.size() <= o3tl::make_unsigned( nType ))
m_updatedTypes.resize( nType + 1 ); // new are default-constructed, i.e. false
m_updatedTypes[ nType ] = value;
if(value)
startTimer();
}
void CallbackFlushHandler::resetUpdatedType( int nType )
@@ -1406,6 +1408,8 @@ void CallbackFlushHandler::setUpdatedTypePerViewId( int nType, int nViewId, int
if( types.size() <= o3tl::make_unsigned( nType ))
types.resize( nType + 1 ); // new are default-constructed, i.e. 'set' is false
types[ nType ] = PerViewIdData{ value, nSourceViewId };
if(value)
startTimer();
}
void CallbackFlushHandler::resetUpdatedTypePerViewId( int nType, int nViewId )
@@ -1730,12 +1734,7 @@ void CallbackFlushHandler::queue(const int type, CallbackData& aCallbackData)
#endif
lock.unlock();
if (!IsActive())
{
Start();
}
if (!m_TimeoutIdle.IsActive())
m_TimeoutIdle.Start();
startTimer();
}
bool CallbackFlushHandler::processInvalidateTilesEvent(int type, CallbackData& aCallbackData)
@@ -2218,6 +2217,14 @@ void CallbackFlushHandler::Invoke()
m_TimeoutIdle.Stop();
}
void CallbackFlushHandler::startTimer()
{
if (!IsActive())
Start();
if (!m_TimeoutIdle.IsActive())
m_TimeoutIdle.Start();
}
bool CallbackFlushHandler::removeAll(int type)
{
bool bErased = false;