fix bug that transparent widget may not be updated in event handler(#431)

This commit is contained in:
Jinhao
2019-05-13 04:28:30 +08:00
parent 5c19c9a9c3
commit 5575a9f2b8
6 changed files with 65 additions and 41 deletions

View File

@@ -91,9 +91,26 @@ namespace nana
private:
bedrock *const brock_;
core_window_t *const wd_;
};
//class root_guard
bedrock::root_guard::root_guard(bedrock& brock, basic_window* root_wd):
brock_(brock),
root_wd_(root_wd)
{
root_wd_->other.attribute.root->lazy_update = true;
}
bedrock::root_guard::~root_guard()
{
if (!brock_.wd_manager().available(root_wd_))
return;
root_wd_->other.attribute.root->lazy_update = false;
root_wd_->other.attribute.root->update_requesters.clear();
}
//end class root_guard
bedrock::core_window_t* bedrock::focus()
{
auto wd = wd_manager().root(native_interface::get_focus_window());