Settings Tab: Fix for https://dev.prusa3d.com/browse/SPE-1229
This commit is contained in:
parent
ff58e73ef2
commit
7380787b3a
@ -3481,6 +3481,28 @@ void Tab::activate_selected_page(std::function<void()> throw_if_canceled)
|
||||
toggle_options();
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
// Override the wxCheckForInterrupt to process inperruptions just from key or mouse
|
||||
// and to avoid an unwanted early call of CallAfter()
|
||||
static bool CheckForInterrupt(wxWindow* wnd)
|
||||
{
|
||||
wxCHECK(wnd, false);
|
||||
|
||||
MSG msg;
|
||||
while (::PeekMessage(&msg, ((HWND)((wnd)->GetHWND())), WM_KEYFIRST, WM_KEYLAST, PM_REMOVE))
|
||||
{
|
||||
::TranslateMessage(&msg);
|
||||
::DispatchMessage(&msg);
|
||||
}
|
||||
while (::PeekMessage(&msg, ((HWND)((wnd)->GetHWND())), WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE))
|
||||
{
|
||||
::TranslateMessage(&msg);
|
||||
::DispatchMessage(&msg);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif //WIN32
|
||||
|
||||
bool Tab::tree_sel_change_delayed()
|
||||
{
|
||||
// There is a bug related to Ubuntu overlay scrollbars, see https://github.com/prusa3d/PrusaSlicer/issues/898 and https://github.com/prusa3d/PrusaSlicer/issues/952.
|
||||
@ -3517,7 +3539,7 @@ bool Tab::tree_sel_change_delayed()
|
||||
|
||||
auto throw_if_canceled = std::function<void()>([this](){
|
||||
#ifdef WIN32
|
||||
wxCheckForInterrupt(m_treectrl);
|
||||
CheckForInterrupt(m_treectrl);
|
||||
if (m_page_switch_planned)
|
||||
throw UIBuildCanceled();
|
||||
#else // WIN32
|
||||
|
Loading…
Reference in New Issue
Block a user