From 5d7dcef619bd1f866684b57351dde2efbda6959c Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 8 Feb 2022 21:15:31 +0800 Subject: ... --- include/cru/ui/host/WindowHost.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/cru/ui/host/WindowHost.h b/include/cru/ui/host/WindowHost.h index caa50397..8a8f1da5 100644 --- a/include/cru/ui/host/WindowHost.h +++ b/include/cru/ui/host/WindowHost.h @@ -29,7 +29,9 @@ class CRU_UI_API WindowHost : public Object { ~WindowHost() override; public: - platform::gui::INativeWindow* GetNativeWindow() { return native_window_; } + platform::gui::INativeWindow* GetNativeWindow() { + return native_window_.get(); + } // Mark the layout as invalid, and arrange a re-layout later. // This method could be called more than one times in a message cycle. But @@ -103,7 +105,7 @@ class CRU_UI_API WindowHost : public Object { void SetOverrideCursor(std::shared_ptr cursor); private: - gsl::not_null CreateNativeWindow(); + std::unique_ptr CreateNativeWindow(); //*************** region: native messages *************** void OnNativeDestroy(platform::gui::INativeWindow* window, std::nullptr_t); @@ -140,7 +142,7 @@ class CRU_UI_API WindowHost : public Object { controls::Control* root_control_ = nullptr; render::RenderObject* root_render_object_ = nullptr; - platform::gui::INativeWindow* native_window_ = nullptr; + std::unique_ptr native_window_; std::unique_ptr layout_paint_cycler_; -- cgit v1.2.3