diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2015-01-31 17:40:48 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2015-02-04 15:44:09 +0100 |
commit | 06d731428ef6cf93c7333e8228bfb6088853b52f (patch) | |
tree | dbdcbed014fdbc7f1369e888a5903e493b3aabcb /vcl/inc | |
parent | e6a58b5e69b83e01b5291b1d8629927e05447797 (diff) |
make idle timers actually activate only when idle
Without this, they can activate after any call to the event processing,
so they may activate in cases such as when updating progressbar while
loading a document, or on repeated user input (so things like showing
spellchecking get updated when the app is busy redrawing). This change
makes idle timers activate only when there's nothing more for the event
loop to process. It's a bit of a question if this doesn't break something
that happens to expect idle timers to be not-really-idle timers, but oh well.
No change for non-X11 platforms, as there's I don't know how to check
the event queues.
Change-Id: I074a88f2f5eeb4b456a11916a0ec2ad6f54dfbab
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/saltimer.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/salwtype.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkdata.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/saldata.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/saldisp.hxx | 1 |
5 files changed, 7 insertions, 4 deletions
diff --git a/vcl/inc/saltimer.hxx b/vcl/inc/saltimer.hxx index 3bdfbc358da6..1e1a941c1287 100644 --- a/vcl/inc/saltimer.hxx +++ b/vcl/inc/saltimer.hxx @@ -47,10 +47,10 @@ public: m_pProc = pProc; } - void CallCallback() + void CallCallback( bool idle ) { if( m_pProc ) - m_pProc(); + m_pProc( idle ); } }; diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx index 805581316504..7a14df0ee103 100644 --- a/vcl/inc/salwtype.hxx +++ b/vcl/inc/salwtype.hxx @@ -281,7 +281,7 @@ struct SalInputContext sal_uLong mnOptions; }; -typedef void (*SALTIMERPROC)(); +typedef void (*SALTIMERPROC)( bool idle ); #endif // INCLUDED_VCL_INC_SALWTYPE_HXX diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index 9c2c76eaa4d3..e2702049d67d 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -99,6 +99,7 @@ class GtkData : public SalGenericData GSource *m_pUserEvent; oslMutex m_aDispatchMutex; oslCondition m_aDispatchCondition; + bool blockIdleTimeout; public: GtkData( SalInstance *pInstance ); @@ -120,6 +121,7 @@ public: virtual bool ErrorTrapPop( bool bIgnoreError ) SAL_OVERRIDE; inline GtkSalDisplay *GetGtkDisplay() const; + bool BlockIdleTimeout() const { return blockIdleTimeout; } }; class GtkSalFrame; diff --git a/vcl/inc/unx/saldata.hxx b/vcl/inc/unx/saldata.hxx index 2c5823177217..0dba4c960c9e 100644 --- a/vcl/inc/unx/saldata.hxx +++ b/vcl/inc/unx/saldata.hxx @@ -77,7 +77,7 @@ public: void StartTimer( sal_uLong nMS ); inline void StopTimer(); - void Timeout() const; + void Timeout( bool idle ) const; // X errors virtual void ErrorTrapPush() SAL_OVERRIDE; diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx index 63b8bae33ede..aa635650186a 100644 --- a/vcl/inc/unx/saldisp.hxx +++ b/vcl/inc/unx/saldisp.hxx @@ -157,6 +157,7 @@ protected: timeval m_aTimeout; sal_uLong m_nTimeoutMS; int m_pTimeoutFDS[2]; + bool blockIdleTimeout; int nFDs_; fd_set aReadFDS_; |