remove sync_child_root_display function
The display state of root widget(nested_form) now no longer depends on its parent widget's visibility. Otherwise, the solution is complicated and error-prone, it is impossible to maintain the correct state when the visibility of root widget is changed directly by system API.
This commit is contained in:
parent
a21a5e940d
commit
886eac6be4
@ -733,30 +733,6 @@ namespace detail
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sync_child_root_display(window_manager::core_window_t* wd)
|
|
||||||
{
|
|
||||||
for (auto & child : wd->children)
|
|
||||||
{
|
|
||||||
if (category::flags::root != child->other.category)
|
|
||||||
{
|
|
||||||
sync_child_root_display(child);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto const vs_parents = child->visible_parents();
|
|
||||||
|
|
||||||
if (vs_parents != child->visible)
|
|
||||||
{
|
|
||||||
native_interface::show_window(child->root, vs_parents, false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (child->visible != native_interface::is_window_visible(child->root))
|
|
||||||
native_interface::show_window(child->root, child->visible, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//show
|
//show
|
||||||
//@brief: show or hide a window
|
//@brief: show or hide a window
|
||||||
bool window_manager::show(core_window_t* wd, bool visible)
|
bool window_manager::show(core_window_t* wd, bool visible)
|
||||||
@ -792,15 +768,8 @@ namespace detail
|
|||||||
bedrock::instance().event_expose(wd, visible);
|
bedrock::instance().event_expose(wd, visible);
|
||||||
|
|
||||||
if (nv)
|
if (nv)
|
||||||
{
|
|
||||||
if (visible && !wd->visible_parents())
|
|
||||||
return true;
|
|
||||||
|
|
||||||
native_interface::show_window(nv, visible, wd->flags.take_active);
|
native_interface::show_window(nv, visible, wd->flags.take_active);
|
||||||
}
|
}
|
||||||
|
|
||||||
sync_child_root_display(wd);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user