mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-08 13:19:17 +01:00
Merge branch 'master' into feat/renderers-cleanup
This commit is contained in:
@@ -407,14 +407,21 @@ bool ui_layer::init(GLFWwindow *Window)
|
||||
}
|
||||
|
||||
// panels can be docked together, and dragged out of the simulator window into windows of their own (e.g. on another monitor)
|
||||
// when both backends can do it. glfw can't place windows under wayland. both flags have to be set before the first frame
|
||||
// when both backends can do it. glfw can't place windows under wayland. gamescope does not work well with popup windows.
|
||||
// both flags have to be set before the first frame
|
||||
m_imguiio->ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
||||
const char* desktop = std::getenv("XDG_CURRENT_DESKTOP");
|
||||
const char* gamepadui = std::getenv("SteamGamepadUI");
|
||||
if (!desktop) desktop = "";
|
||||
if (!gamepadui) gamepadui = "";
|
||||
auto const viewportsupport{(m_imguiio->BackendFlags & ImGuiBackendFlags_PlatformHasViewports) && (m_imguiio->BackendFlags & ImGuiBackendFlags_RendererHasViewports) &&
|
||||
glfwGetPlatform() != GLFW_PLATFORM_WAYLAND};
|
||||
glfwGetPlatform() != GLFW_PLATFORM_WAYLAND && std::string_view{desktop} != "gamescope" && std::string_view{gamepadui} != "1"};
|
||||
if (Global.ui_viewports && viewportsupport)
|
||||
{
|
||||
m_imguiio->ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
|
||||
m_imguiio->ConfigViewportsNoTaskBarIcon = true;
|
||||
// only dragging a panel with the cursor past the main window takes it out, not resizing it or placing it at the edge
|
||||
m_imguiio->ConfigViewportsNoAutoDetach = true;
|
||||
auto &platformio{ImGui::GetPlatformIO()};
|
||||
imgui_create_window = platformio.Platform_CreateWindow;
|
||||
platformio.Platform_CreateWindow = create_viewport_window;
|
||||
|
||||
Reference in New Issue
Block a user