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

@@ -740,27 +740,6 @@ namespace detail
return static_cast<wchar_t>(vkey);
}
class window_proc_guard
{
public:
window_proc_guard(detail::basic_window* wd) :
root_wd_(wd)
{
root_wd_->other.attribute.root->lazy_update = true;
}
~window_proc_guard()
{
if (!bedrock::instance().wd_manager().available(root_wd_))
return;
root_wd_->other.attribute.root->lazy_update = false;
root_wd_->other.attribute.root->update_requesters.clear();
}
private:
detail::basic_window* const root_wd_;
};
LRESULT CALLBACK Bedrock_WIN32_WindowProc(HWND root_window, UINT message, WPARAM wParam, LPARAM lParam)
{
LRESULT window_proc_value = 0;
@@ -793,7 +772,7 @@ namespace detail
auto const root_wd = root_runtime->window;
auto msgwnd = root_wd;
window_proc_guard wp_guard{ root_wd };
detail::bedrock::root_guard rw_guard{ brock, root_wd };
switch (message)
{
@@ -1577,14 +1556,7 @@ namespace detail
def_window_proc = true;
}
if (wd_manager.available(root_wd) && root_wd->other.attribute.root->update_requesters.size())
{
for (auto wd : root_wd->other.attribute.root->update_requesters)
{
window_layout::paint(wd, window_layout::paint_operation::have_refreshed, false);
wd_manager.map(wd, true);
}
}
wd_manager.update_requesters(root_wd);
root_runtime = wd_manager.root_runtime(native_window);
if(root_runtime)