From 841fa0812c8244c269a2677444de3ddf129f680d Mon Sep 17 00:00:00 2001 From: Jinhao Date: Wed, 15 Aug 2018 23:07:38 +0800 Subject: [PATCH] fix bug that nested_form mistakely renders sibling as its child --- source/gui/detail/window_layout.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/source/gui/detail/window_layout.cpp b/source/gui/detail/window_layout.cpp index 45764b81..19ec8133 100644 --- a/source/gui/detail/window_layout.cpp +++ b/source/gui/detail/window_layout.cpp @@ -166,10 +166,18 @@ namespace nana if (!cover->visible) continue; - if (is_wd_root ? - (category::flags::root == cover->other.category) - : - ((category::flags::root != cover->other.category) && (nullptr == cover->effect.bground))) + if (is_wd_root) + { + if(category::flags::root == cover->other.category) + { + if (overlap(vis_rect, rectangle{ native_interface::window_position(cover->root), cover->dimension }, block.r)) + { + block.window = cover; + blocks.push_back(block); + } + } + } + else if((category::flags::root != cover->other.category) && (nullptr == cover->effect.bground)) { if (overlap(vis_rect, rectangle{ cover->pos_root, cover->dimension }, block.r)) {