enkisoftware / imgui_markdown

Markdown for Dear ImGui
zlib License
1.03k stars 69 forks source link

Call link callback on mouse released, not mouse clicked #12

Closed ClaasJG closed 3 years ago

ClaasJG commented 3 years ago

Hi,

this pull request changes the moment, the link callback will be called.

With this pull request links are not going to be called, when the mouse went from !down to down, but when it went from down to !down.

Why:

In my application, I use links to switch windows within my application. (You can open windows from the user help, which uses markdown). I do this using ImGui::SetWindowFocus which does not work as intended in a docking environment, when the links activate on mouse down (the window containing the markdown will steal the focus immediately back).

Furthermore its what I as an user expect. (i.e. in Google Chrome links open on mouse up, not mouse down)

Thanks for imgui_markdown!

ClaasJG

juliettef commented 3 years ago

Thanks, this makes sense.