diff options
author | 杨宇千 <crupest@outlook.com> | 2019-08-12 01:03:02 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-08-12 01:03:02 +0800 |
commit | 04367ead7027e9f0359d24681f5cc0dd916b934d (patch) | |
tree | f2a277ac9d53863c9f4efc8099450138974bdb4d /src/ui/window.cpp | |
parent | 86e776eaebf7c45a269001ca7da0dfafba069d0a (diff) | |
download | cru-04367ead7027e9f0359d24681f5cc0dd916b934d.tar.gz cru-04367ead7027e9f0359d24681f5cc0dd916b934d.tar.bz2 cru-04367ead7027e9f0359d24681f5cc0dd916b934d.zip |
...
Diffstat (limited to 'src/ui/window.cpp')
-rw-r--r-- | src/ui/window.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ui/window.cpp b/src/ui/window.cpp index 47509749..1ec34c1d 100644 --- a/src/ui/window.cpp +++ b/src/ui/window.cpp @@ -7,6 +7,7 @@ #include "routed_event_dispatch.hpp" #include <cassert> +#include <list> namespace cru::ui { namespace { @@ -54,6 +55,7 @@ Control* FindLowestCommonAncestor(Control* left, Control* right, *find_result = in_right; return result; } + ++right_i; } return result; } @@ -64,6 +66,7 @@ Control* FindLowestCommonAncestor(Control* left, Control* right, *find_result = in_left; return result; } + ++left_i; } return result; } @@ -75,13 +78,16 @@ Control* FindLowestCommonAncestor(Control* left, Control* right, *find_result = in_right; return result; } + ++right_i; } while (left_i != left_list.cend()) { if (*left_i == find_control) { *find_result = in_left; return result; } + ++left_i; } + return result; } ++left_i; ++right_i; @@ -107,9 +113,11 @@ Window::Window(tag_overlapped_constructor) : mouse_hover_control_(nullptr), focus_control_(this), mouse_captured_control_(nullptr) { + window_ = this; native_window_ = platform::native::UiApplication::GetInstance()->CreateWindow(nullptr); render_object_.reset(new render::WindowRenderObject(this)); + render_object_->SetAttachedControl(this); BindNativeEvent(this, native_window_->DestroyEvent(), &Window::OnNativeDestroy, event_revoker_guards_); |