Kick the refresh timer for GAL on Win32 with a terrible hack
This commit is contained in:
parent
1739f1b6ea
commit
88102bca46
|
@ -40,6 +40,8 @@
|
|||
#include <gal/opengl/opengl_gal.h>
|
||||
#include <gal/cairo/cairo_gal.h>
|
||||
|
||||
#include <kiplatform/app.h>
|
||||
|
||||
#include <tool/tool_dispatcher.h>
|
||||
#include <tool/tool_manager.h>
|
||||
|
||||
|
@ -295,6 +297,10 @@ void EDA_DRAW_PANEL_GAL::onSize( wxSizeEvent& aEvent )
|
|||
|
||||
void EDA_DRAW_PANEL_GAL::Refresh( bool aEraseBackground, const wxRect* aRect )
|
||||
{
|
||||
// Call to ensure the refresh timer eventually fires during rapid mouse moves
|
||||
// Required for win32
|
||||
KIPLATFORM::APP::ForceTimerMessagesToBeCreatedIfNecessary();
|
||||
|
||||
if( m_pendingRefresh )
|
||||
return;
|
||||
|
||||
|
|
|
@ -50,4 +50,9 @@ void KIPLATFORM::APP::RemoveShutdownBlockReason( wxWindow* aWindow )
|
|||
|
||||
void KIPLATFORM::APP::SetShutdownBlockReason( wxWindow* aWindow, const wxString& aReason )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void KIPLATFORM::APP::ForceTimerMessagesToBeCreatedIfNecessary()
|
||||
{
|
||||
}
|
|
@ -64,6 +64,17 @@ namespace KIPLATFORM
|
|||
* @param aWindow that has a shutdown block reason set
|
||||
*/
|
||||
void RemoveShutdownBlockReason( wxWindow* aWindow );
|
||||
|
||||
/**
|
||||
* Forces wxTimers to fire more promptly on Win32.
|
||||
*
|
||||
* wxTimers on win32 are not real timers
|
||||
* They live in the message pump at the absolute lowest priority (only when no other events are pending)
|
||||
* This functions "peeks" the message pump which causes them to get queued immediately
|
||||
*
|
||||
* Call as needed in an application to ensure timers are dispatched
|
||||
*/
|
||||
void ForceTimerMessagesToBeCreatedIfNecessary();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -71,4 +71,12 @@ void KIPLATFORM::APP::SetShutdownBlockReason( wxWindow* aWindow, const wxString&
|
|||
ShutdownBlockReasonDestroy( aWindow->GetHandle() ); // Destroys any existing or nonexisting reason
|
||||
|
||||
ShutdownBlockReasonCreate( aWindow->GetHandle(), aReason.wc_str() );
|
||||
}
|
||||
|
||||
|
||||
void KIPLATFORM::APP::ForceTimerMessagesToBeCreatedIfNecessary()
|
||||
{
|
||||
// Taken from https://devblogs.microsoft.com/oldnewthing/20191108-00/?p=103080
|
||||
MSG msg;
|
||||
PeekMessage( &msg, nullptr, WM_TIMER, WM_TIMER, PM_NOREMOVE );
|
||||
}
|
|
@ -50,4 +50,9 @@ void KIPLATFORM::APP::RemoveShutdownBlockReason( wxWindow* aWindow )
|
|||
|
||||
void KIPLATFORM::APP::SetShutdownBlockReason( wxWindow* aWindow, const wxString& aReason )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void KIPLATFORM::APP::ForceTimerMessagesToBeCreatedIfNecessary()
|
||||
{
|
||||
}
|
Loading…
Reference in New Issue