FreeCAD natively under Gnome/Wayland
FreeCAD natively under Gnome/Wayland
Hi,
with Qt 5.12 it is possible to run FreeCAD natively under Wayland. All window decorations are nicely drawn. It is also crisper on HiDPI displays because scaling is handled better. I had to hack the Coin3d build to prevent the linking with libglx, because otherwise FreeCAD would crash as soon as a new document is created or opened.
Cheers, Torsten
with Qt 5.12 it is possible to run FreeCAD natively under Wayland. All window decorations are nicely drawn. It is also crisper on HiDPI displays because scaling is handled better. I had to hack the Coin3d build to prevent the linking with libglx, because otherwise FreeCAD would crash as soon as a new document is created or opened.
Cheers, Torsten
- Attachments
-
- FreeCAD_Wayland.png (395.1 KiB) Viewed 5508 times
Re: FreeCAD natively under Gnome/Wayland
Thank you for your report, Torsten. I had been wondering about it, since Linux distros are gradually phasing out the old X server.
Re: FreeCAD natively under Gnome/Wayland
Very nice!! Haven't tried wayland yet, but it's impressive to see that a complex 3D app with lots of (some old) dependencies like freecad works...
Re: FreeCAD natively under Gnome/Wayland
@tsadowski can you show the code that you hacked to make this happen ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: FreeCAD natively under Gnome/Wayland
It was quite easy. Coin works without glx for FreeCAD probably because the funtionality is not needed by FreeCAD and Coin has a dummy implementation. I just had to add a patch to the Arch build recipy:
https://aur.archlinux.org/packages/coin-hg/
not to find glx:
I tried to add some runtime workarounds in FreeCAD but this is awkward and probably doomed. Coin probably needs to use EGL instead of GLX. I will check if there is an easy solution and contact the Coin team.
Cheers,
Torsten
https://aur.archlinux.org/packages/coin-hg/
not to find glx:
Code: Select all
diff -ura coin/CMakeLists.txt coin.new/CMakeLists.txt
--- coin/CMakeLists.txt 2019-01-10 00:06:52.081521372 +0100
+++ coin.new/CMakeLists.txt 2019-01-10 00:08:32.785648305 +0100
@@ -431,7 +431,7 @@
check_include_files("GL/gl.h" HAVE_GL_GL_H)
check_include_files("GL/glu.h" HAVE_GL_GLU_H)
check_include_files("GL/gl.h;GL/glext.h" HAVE_GL_GLEXT_H)
- check_include_files("GL/glx.h" HAVE_GLX_H)
+# check_include_files("GL/glx.h" HAVE_GLX_H)
endif()
check_include_file(OpenGL/gl.h HAVE_OPENGL_GL_H)
@@ -459,9 +459,9 @@
check_symbol_exists(CGL_VERSION_1_0 OpenGL/OpenGL.h HAVE_CGL)
set(HAVE_CGL_PBUFFER ${HAVE_CGL})
-if(NOT (HAVE_WGL OR HAVE_AGL OR HAVE_CGL))
- check_library_exists(GL glXChooseVisual "" HAVE_GLX)
-endif()
+#if(NOT (HAVE_WGL OR HAVE_AGL OR HAVE_CGL))
+# check_library_exists(GL glXChooseVisual "" HAVE_GLX)
+#endif()
if(HAVE_WINDOWS_H)
set(SIM_INCLUDE_WINDOWS_H "#include <windows.h>")
Cheers,
Torsten
Re: FreeCAD natively under Gnome/Wayland
That would be great. Likely still a few years before Wayland becomes more widely used and majority of applications add support. But FreeCAD providing support should happen sooner rather than later. If possible. Therefore Coin3D needs to get adapted and as for the Qt. You likely had to use QtWayland module in the procedure somehow? Can Wayland/X11 option be set with an environment variable before starting FreeCAD?
- hobbes1069
- Posts: 290
- Joined: Wed Nov 09, 2011 3:49 pm
- Location: Southaven, MS
Re: FreeCAD natively under Gnome/Wayland
Any luck with the Coin team with EGL support?
Thanks,
Richard
- hobbes1069
- Posts: 290
- Joined: Wed Nov 09, 2011 3:49 pm
- Location: Southaven, MS
Re: FreeCAD natively under Gnome/Wayland
For posterity with the current 4.0.0 release I had to update the patch to the following:
Thanks,
Richard
Code: Select all
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -586,11 +586,11 @@ if(NOT (HAVE_WGL OR HAVE_AGL OR HAVE_CGL
list(APPEND COIN_TARGET_LINK_LIBRARIES OpenGL::GLX)
endif()
set(CMAKE_REQUIRED_LIBRARIES ${COIN_TARGET_LINK_LIBRARIES})
- check_cxx_source_compiles("
- #include <GL/gl.h>
- #include <GL/glx.h>
- int main() { (void)glXChooseVisual(0L, 0, 0L); glEnd(); return 0; }
- " HAVE_GLX)
+# check_cxx_source_compiles("
+# #include <GL/gl.h>
+# #include <GL/glx.h>
+# int main() { (void)glXChooseVisual(0L, 0, 0L); glEnd(); return 0; }
+# " HAVE_GLX)
endif()
# Checks specific OpenGL configurations
Richard
Re: FreeCAD natively under Gnome/Wayland
I don't see any issues open in the Coin issue tracker on this topic - https://bitbucket.org/Coin3D/coin/issue ... tatus=open
Would someone (with a better grasp of the topic than I) file one?
Would someone (with a better grasp of the topic than I) file one?
- kkremitzki
- Veteran
- Posts: 2417
- Joined: Thu Mar 03, 2016 9:52 pm
- Location: Illinois
Re: FreeCAD natively under Gnome/Wayland
BTW, a move to github.com/coin3d is underway.