Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from GLFW to SDL #798

Open
azonenberg opened this issue Nov 2, 2024 · 6 comments
Open

Migrate from GLFW to SDL #798

azonenberg opened this issue Nov 2, 2024 · 6 comments
Labels
core Core application logic portability Stuff that doesn't work on some OS tabled Plans for the future. Not ready to write code yet.

Comments

@azonenberg
Copy link
Collaborator

GLFW has a bunch of bugs related to mouse handling on Linux causing false mouse-up events when a new platform window is created.

There may be ugly hacks we can do on the backend, but SDL doesn't have this issue so that's probably the best path forward. We only make 20ish GLFW API calls so the port shouldn't be too difficult.

See: ocornut/imgui#7922

@azonenberg azonenberg added bug Something isn't working core Core application logic portability Stuff that doesn't work on some OS labels Nov 2, 2024
@azonenberg azonenberg added this to the v0.2 milestone Nov 2, 2024
@Johnsel
Copy link
Contributor

Johnsel commented Nov 3, 2024

Hate to say it (actually I kinda enjoy it, sorry 🤣), but didn't I propose also switching to SDL2 already when we switched to imgui? It's a much newer and better backend than glfw.

But glad you're finally convinced. It'd open up some more interesting ports as well.

(also offering dev time here to actually make it happen)

@azonenberg
Copy link
Collaborator Author

Tagging just for posterity: it appears ocornut/imgui#7733 (a minor annoyance that had been plaguing us for a while) is rooted in the same bug and can also be fixed by leaving GLFW.

@ocornut
Copy link

ocornut commented Nov 3, 2024

FYI if there are hacks to do on the GLFW backend its worth adding them imho. All backends have hacks/quirks, as the windowing emulation of multi-viewports is generally a bit out of the typical expected scope of SDL/GLFW. I would just need to understand exactly what’s the low level issue (perhaps that info is already detailed in existing high-level issues).

@azonenberg
Copy link
Collaborator Author

FYI if there are hacks to do on the GLFW backend its worth adding them imho. All backends have hacks/quirks, as the windowing emulation of multi-viewports is generally a bit out of the typical expected scope of SDL/GLFW. I would just need to understand exactly what’s the low level issue (perhaps that info is already detailed in existing high-level issues).

It appears the root cause is glfw/glfw#1562 (comment).

If you can add a workaround on the ImGui side, that would be great.

@ocornut
Copy link

ocornut commented Nov 4, 2024

I posted a tentative workaround here:
ocornut/imgui#7733 (comment)
Would be nice if you can also test it on your end.

@azonenberg azonenberg added the tabled Plans for the future. Not ready to write code yet. label Nov 5, 2024
@azonenberg azonenberg removed this from the v0.2 milestone Nov 5, 2024
@azonenberg azonenberg removed the bug Something isn't working label Nov 5, 2024
@azonenberg
Copy link
Collaborator Author

Keeping this open as a potential future trajectory for the project, but no longer a v0.2 priority now that there is an imgui workaround for the specific GLFW issues in play.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core application logic portability Stuff that doesn't work on some OS tabled Plans for the future. Not ready to write code yet.
Projects
None yet
Development

No branches or pull requests

3 participants