18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-19 01:46:01 +01:00

Merge pull request #299 from MaSzyna-EU07/fix/ui-tooltips-stay-in-window

fix(ui): tooltips and popups stay in the main window, and a long tooltip wraps
This commit is contained in:
2026-11-09 12:46:56 +00:00
committed by GitHub
3 changed files with 19 additions and 2 deletions

View File

@@ -409,6 +409,8 @@ bool ui_layer::init(GLFWwindow *Window)
if (!gamepadui) gamepadui = "";
auto const viewportsupport{(m_imguiio->BackendFlags & ImGuiBackendFlags_PlatformHasViewports) && (m_imguiio->BackendFlags & ImGuiBackendFlags_RendererHasViewports) &&
glfwGetPlatform() != GLFW_PLATFORM_WAYLAND && std::string_view{desktop} != "gamescope" && std::string_view{gamepadui} != "1"};
// a tooltip as long as a paragraph is wrapped: in one line it can run past the screen
m_imguiio->ConfigTooltipsWrapWidth = std::round(Global.ui_fontsize * 40.0f);
if (Global.ui_viewports && viewportsupport)
{
m_imguiio->ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;