mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-07 00:22:56 +01:00
Merge branch 'master' into feat/renderers-cleanup
This commit is contained in:
@@ -726,11 +726,12 @@ void eu07_application::exit()
|
||||
|
||||
ui_layer::shutdown();
|
||||
|
||||
// the python workers detach their GL context on the way out, so they have to be done before the windows they use are destroyed
|
||||
m_taskqueue.exit();
|
||||
for (auto *window : m_windows)
|
||||
{
|
||||
glfwDestroyWindow(window);
|
||||
}
|
||||
m_taskqueue.exit();
|
||||
glfwPollEvents(); // TODO: This fixes a segfault on Wayland when closing. Remove after updating glfw to 3.5.
|
||||
glfwTerminate();
|
||||
|
||||
|
||||
@@ -183,6 +183,10 @@ void create_viewport_window(ImGuiViewport *Viewport)
|
||||
imgui_create_window(Viewport);
|
||||
if (Viewport->PlatformHandle != nullptr)
|
||||
glfwSetKeyCallback(static_cast<GLFWwindow *>(Viewport->PlatformHandle), ui_layer::viewport_key_callback);
|
||||
#ifdef _WIN32
|
||||
if (Viewport->PlatformHandleRaw != nullptr)
|
||||
::SetWindowLongPtr(static_cast<HWND>(Viewport->PlatformHandleRaw), GWLP_HWNDPARENT, reinterpret_cast<LONG_PTR>(ImGui::GetMainViewport()->PlatformHandleRaw));
|
||||
#endif
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -292,6 +296,8 @@ bool ui_layer::init(GLFWwindow *Window)
|
||||
IMGUI_CHECKVERSION();
|
||||
ImGui::CreateContext();
|
||||
m_imguiio = &ImGui::GetIO();
|
||||
ImGui::GetCurrentContext()->ConfigNavWindowingKeyNext = ImGuiKey_None;
|
||||
ImGui::GetCurrentContext()->ConfigNavWindowingKeyPrev = ImGuiKey_None;
|
||||
// imgui.ini is read with the first frame, which may be of another mode than the editor
|
||||
editor_ui::register_settings();
|
||||
|
||||
@@ -408,6 +414,7 @@ bool ui_layer::init(GLFWwindow *Window)
|
||||
if (Global.ui_viewports && viewportsupport)
|
||||
{
|
||||
m_imguiio->ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
|
||||
m_imguiio->ConfigViewportsNoTaskBarIcon = true;
|
||||
auto &platformio{ImGui::GetPlatformIO()};
|
||||
imgui_create_window = platformio.Platform_CreateWindow;
|
||||
platformio.Platform_CreateWindow = create_viewport_window;
|
||||
|
||||
Reference in New Issue
Block a user