From 49cd06407a183844ce5290f730d300aad8f638a9 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Mon, 11 Jun 2018 16:56:35 +0200 Subject: [PATCH] There is a bug related to Ubuntu overlay scrollbars, see https://github.com/prusa3d/Slic3r/issues/898 and https://github.com/prusa3d/Slic3r/issues/952. The issue apparently manifests when Show()ing a window with overlay scrollbars while the UI is frozen. For this reason, we will Thaw the UI prematurely on Linux. This means destroing the no_updates object prematurely. --- xs/src/slic3r/GUI/Tab.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp index f24b5ebc6d..6eabc2f474 100644 --- a/xs/src/slic3r/GUI/Tab.cpp +++ b/xs/src/slic3r/GUI/Tab.cpp @@ -2056,7 +2056,15 @@ bool Tab::may_discard_current_dirty_preset(PresetCollection* presets /*= nullptr void Tab::OnTreeSelChange(wxTreeEvent& event) { if (m_disable_tree_sel_changed_event) return; + +// There is a bug related to Ubuntu overlay scrollbars, see https://github.com/prusa3d/Slic3r/issues/898 and https://github.com/prusa3d/Slic3r/issues/952. +// The issue apparently manifests when Show()ing a window with overlay scrollbars while the UI is frozen. For this reason, +// we will Thaw the UI prematurely on Linux. This means destroing the no_updates object prematurely. +#ifdef __linux__ + std::unique_ptr no_updates(new wxWindowUpdateLocker(this)); +#else wxWindowUpdateLocker noUpdates(this); +#endif Page* page = nullptr; auto selection = m_treectrl->GetItemText(m_treectrl->GetSelection()); @@ -2072,6 +2080,11 @@ void Tab::OnTreeSelChange(wxTreeEvent& event) for (auto& el : m_pages) el.get()->Hide(); + +#ifdef __linux__ + no_updates.reset(nullptr); +#endif + page->Show(); m_hsizer->Layout(); Refresh();