summaryrefslogtreecommitdiff
path: root/vcl/inc/win/saltimer.h
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-10-12 18:19:12 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2017-10-13 16:49:22 +0200
commitabe3af8e9871907aa75b913f2b8094cac651bc6d (patch)
treec3a4a6a623988d3d79c12baff6c4dcf624055c1a /vcl/inc/win/saltimer.h
parent3bf6c97029d26ddf20007c47ca6b68e5cc52d846 (diff)
WIN fix redraw during window move and resize
During window move and resize, Windows spawns a nested message loop, blocking our direct processing. In this case we switch to timer messages for all timeouts. But if LO is busy with background jobs, the posted 0ms timer messages will block any system event processing, halting any updates until we're idle again. So for these cases we switch to the WM_TIMER based SetTimer timer. Change-Id: I854f4984d7c75d6829f82cda5cb4479967edce48 Reviewed-on: https://gerrit.libreoffice.org/43350 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/inc/win/saltimer.h')
-rw-r--r--vcl/inc/win/saltimer.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/vcl/inc/win/saltimer.h b/vcl/inc/win/saltimer.h
index 68973e1cadc3..d762b51b6716 100644
--- a/vcl/inc/win/saltimer.h
+++ b/vcl/inc/win/saltimer.h
@@ -31,13 +31,20 @@ class WinSalTimer final : public SalTimer, protected VersionedEvent
// for access to ImplHandleElapsedTimer
friend bool ImplSalYield( bool bWait, bool bHandleAllCurrentEvents );
+ /**
+ * Identifier for our SetTimer based timer
+ */
+ static constexpr UINT_PTR m_aWmTimerId = 0xdeadbeef;
+
HANDLE m_nTimerId; ///< Windows timer id
bool m_bDirectTimeout; ///< timeout can be processed directly
+ bool m_bForceRealTimer; ///< enforce using a real timer for 0ms
void ImplStart( sal_uIntPtr nMS );
void ImplStop();
void ImplHandleTimerEvent( WPARAM aWPARAM );
void ImplHandleElapsedTimer();
+ void ImplHandle_WM_TIMER( WPARAM aWPARAM );
public:
WinSalTimer();
@@ -48,6 +55,14 @@ public:
inline bool IsDirectTimeout() const;
inline bool HasTimerElapsed() const;
+
+ /**
+ * Enforces the usage of a real timer instead of the message queue
+ *
+ * Needed for Window resize processing, as this starts a modal event loop.
+ */
+ void SetForceRealTimer( bool bVal );
+ inline bool GetForceRealTimer() const;
};
inline bool WinSalTimer::IsDirectTimeout() const
@@ -60,6 +75,11 @@ inline bool WinSalTimer::HasTimerElapsed() const
return m_bDirectTimeout || ExistsValidEvent();
}
+inline bool WinSalTimer::GetForceRealTimer() const
+{
+ return m_bForceRealTimer;
+}
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */