From a9983101ab50d506c2fce554650bbc1e915d7e8d Mon Sep 17 00:00:00 2001 From: Jinhao Date: Tue, 13 Oct 2015 23:11:57 +0800 Subject: [PATCH] avoid double-copying a window while its parent is refreshing --- source/gui/detail/window_manager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/gui/detail/window_manager.cpp b/source/gui/detail/window_manager.cpp index 3cb72140..ea26fd02 100644 --- a/source/gui/detail/window_manager.cpp +++ b/source/gui/detail/window_manager.cpp @@ -676,6 +676,14 @@ namespace detail std::lock_guard lock(mutex_); if (impl_->wd_register.available(wd) && !wd->is_draw_through()) { + auto parent = wd->parent; + while (parent) + { + if (parent->flags.refreshing) + return; + parent = parent->parent; + } + //Copy the root buffer that wd specified into DeviceContext #if defined(NANA_LINUX) wd->drawer.map(reinterpret_cast(wd), forced, update_area);