From 9f291e21da2856dde51f1a6b5b2e1dd934aae000 Mon Sep 17 00:00:00 2001 From: Nanako <469449812@qq.com> Date: Tue, 30 Jul 2024 20:56:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/audio/plugin_host/plugin_host.cpp | 1 + core/window/window_manager.cpp | 16 +++++++++++----- core/window/window_manager.h | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/core/audio/plugin_host/plugin_host.cpp b/core/audio/plugin_host/plugin_host.cpp index efb7e7e..9259955 100644 --- a/core/audio/plugin_host/plugin_host.cpp +++ b/core/audio/plugin_host/plugin_host.cpp @@ -67,6 +67,7 @@ void plugin_host::create_and_open_editor() { return; } on_open_editor(handle); + spdlog::info("{} window created", name.c_str()); } void plugin_host::destroy_editor() { diff --git a/core/window/window_manager.cpp b/core/window/window_manager.cpp index d47f8ba..11e0a1b 100644 --- a/core/window/window_manager.cpp +++ b/core/window/window_manager.cpp @@ -89,13 +89,19 @@ void window_manager::on_host_window_close(GLFWwindow* window) { return info.second.window.get() == window; }); if (f != host_infos_.end()) { - f->first->editor_opened = false; - f->first->on_close_editor(); + auto& info = f->second; + auto host = f->first; + + host->editor_opened = false; + host->on_close_editor(); + int x, y; glfwGetWindowPos(window, &x, &y); - f->second.x = x; - f->second.y = y; - f->second.window.reset(); + info.x = x; + info.y = y; + info.window.reset(); + + spdlog::info("{} window close", host->name.c_str()); } } diff --git a/core/window/window_manager.h b/core/window/window_manager.h index ba7a3ca..ffbe902 100644 --- a/core/window/window_manager.h +++ b/core/window/window_manager.h @@ -13,7 +13,7 @@ public: void release(singleton_release_guard& release_guard) override; std::shared_ptr create_window(int width, int height, const char* title); - void* create_plugin_window(plugin_host* host); + auto create_plugin_window(plugin_host* host) -> void*; void destroy_plugin_window(plugin_host* host); void resize_plugin_window(plugin_host* host, int width, int height); const char* get_name() override { return "window_manager"; }