WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

GLFW backend links with X11 on linux since 1.92.3-docking #9109

@ramenguy99

Description

@ramenguy99

Version/Branch of Dear ImGui:

Version 1.92.3+, Branch: docking

Back-ends:

imgui_impl_glfw.cpp

Compiler, OS:

Linux + Any compiler

Full config/build information:

No response

Details:

Since commit 6b2cdf2 the GLFW backend uses X11 functions directly (e.g. XFlush in ImGui_ImplGlfw_SetWindowFloating). This is a breaking change for some builds because this means that executables and dynamic libraries now need this symbol at link or load time respectively.

GLFW internally loads these function at initialization time with dlopen and calls them through function pointers. This is also potentially bad because the versions of these functions used by GLFW are potentially not the same as those linked at build time or loaded at load time (though I don't really know in which realistic scenario this could actually happen).

The best solution in my opinion would be to use the function pointers loaded by GLFW or expose this functionality in GLFW directly, but there does not seem to be a straight forward way to do this without changes to GLFW (as far as I know).

A workaround would be to put these behind a build flag / define to allow existing code that cannot link with X11 at build or load time to keep working.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions