pthom / imgui_manual

https://pthom.github.io/imgui_manual_online - an interactive manual for ImGui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clicking links in desktop build doesn't open the browser

jrynkiew opened this issue · comments

Hi Pascal,

Screenshot from 2022-03-19 09-29-16

When I build the imgui_manual using desktop mode (on Linux with X11, SDL2, SDL2_Image) everything works great, but clicking links does not open a new browser window. Can this be fixed? Have you investigated this issue before?

Hello,

I did not implement this on desktop mode for linux (since imgui_manual is mainly intended to be used on emscripten).
However, changing this should be easy:

Look at HyperlinkHelper.cpp

Something around this (not tested) should work (if xdg-open is installed)

void OpenUrl(const std::string &url)
{
...
...
...
#elif defined(TARGET_OS_MAC)
        std::string cmd = std::string("open ") + url.c_str();
        system(cmd.c_str());
#elif defined(__linux__)
    std::string cmd = std::string("xdg-open ") + url;
    system(cmd.c_str()); 
#endif

Wow, thank You! It worked like a charm straight away!. You're the boss!