SoftFever 3e4af2c723 WIP: Add native Wayland support for Linux (#13197)
* Add runtime display backend detection for Wayland support

Add LinuxDisplayBackend utility to detect X11 vs Wayland at runtime
using GDK_IS_X11_DISPLAY / GDK_IS_WAYLAND_DISPLAY macros. This is
the foundation for removing the forced GDK_BACKEND=x11 and enabling
native Wayland support.

- New files: LinuxDisplayBackend.hpp/.cpp with get_linux_display_backend(),
  is_running_on_wayland(), and is_running_on_x11()
- Propagate wxHAVE_GDK_X11 / wxHAVE_GDK_WAYLAND from FindGTK3.cmake
  as compile definitions to libslic3r_gui
- No-op on non-Linux platforms (returns Unknown / false)

* Fix Phase 1 code quality: pragma once, source ordering, static cache

* Make X11 initialization conditional for Wayland support

Remove the unconditional GDK_BACKEND=x11 force that blocked native
Wayland. Replace with conditional logic:

- EGL safety fallback: re-force X11 only when wxUSE_GLCANVAS_EGL is
  off and WAYLAND_DISPLAY is set, with a warning log
- XInitThreads() only called when DISPLAY is set (X11 in use)
- __GLX_VENDOR_LIBRARY_NAME only set when DISPLAY is present (GLX-specific)
- WEBKIT_DISABLE_COMPOSITING_MODE only set under XWayland (both
  DISPLAY and WAYLAND_DISPLAY present)
- Guard X11/Xlib.h include with __has_include for robustness
- Restore display validation to accept either DISPLAY or WAYLAND_DISPLAY

This is Phase 2 of the Wayland support plan.

* Fix Phase 2: safer EGL macro check, add clarifying comments

* Add GLAD2 library and replace GLEW linkage in build system

Set up GLAD2 as a static library to replace GLEW for OpenGL loading.
GLAD2 supports both GLX and EGL, which is required for Wayland support.

- Create src/glad/ with pre-generated GLAD2 sources (GL 4.6 compat)
- Add src/glad/CMakeLists.txt building glad as a static library
- Wire glad into src/CMakeLists.txt before libvgcode
- Modify libvgcode to use shared glad for GL path (keeps local copy
  only for GLES2/Emscripten) to avoid duplicate symbol conflicts
- Replace GLEW::GLEW with glad in libslic3r_gui link libraries

Note: GLEW is kept in deps for OpenCSG. Code migration from GL/glew.h
to glad/gl.h headers will follow in Phase 3B+3C.

* Fix Phase 3A+3D: libvgcode GLAD include, dead files, dlopen dep, OpenGL link var

* Migrate from GLEW to GLAD: replace headers and API calls across codebase

Replace all #include <GL/glew.h> with <glad/gl.h> across 49 source files.
Migrate GLEW API calls to GLAD equivalents:
- glewInit/glewExperimental -> gladLoaderLoadGL()
- GLEW_EXT_* / GLEW_ARB_* extension checks -> GLAD_GL_EXT_* / GLAD_GL_ARB_*
- Remove GLEW-specific EGL/GLX mismatch #error guards (not needed with GLAD)
- Replace unavailable EXT symbols with core GL equivalents in
  GLCanvas3D.cpp (GL_MAX_SAMPLES, glRenderbufferStorageMultisample,
  glBlitFramebuffer, GL_READ/DRAW_FRAMEBUFFER)
- Update log messages from glewInit to gladLoadGL

* Fix Phase 3B+3C: remove GLEW find, clean EXT symbols, update attribution

- Remove find_package(GLEW) block from root CMakeLists.txt since GLEW
  is no longer linked by any main application code
- Remove "glew" from SLIC3R_STATIC option description
- Replace all remaining EXT framebuffer symbols with core equivalents
  in render_thumbnail_framebuffer_ext and _rectangular_selection_picking_pass
- Update AboutDialog credits from GLEW to GLAD

* Enable EGL in wxWidgets and add runtime GLX/EGL selection for Wayland

- Set wxUSE_GLCANVAS_EGL=ON in wxWidgets build and Flatpak manifest
- Add PreferGLX() call on X11 sessions for driver compatibility
- Remove Phase 2 safety fallback (EGL is now always compiled in)
- Guard SwapBuffers against hidden canvases to prevent Wayland stalls

* Fix Phase 4: move PreferGLX to app startup, fix FPS counter guard

Move wxGLCanvas::PreferGLX() from OpenGLManager::create_wxglcanvas()
(static initializer) to GUI_App::on_init_inner() before any wxGLCanvas
is constructed. This prevents a race where SkipPartCanvas could trigger
wxGLBackend::Init() before the GLX preference is set. The new location
also adds explicit is_running_on_wayland() detection with a warning for
unknown backends.

Move increment_fps_counter() inside the IsShownOnScreen() guard so FPS
is only counted when a frame is actually swapped.

* Update GLFW from 3.3.7 to 3.4 for runtime Wayland/X11 backend selection

Replace the compile-time GLFW_USE_WAYLAND flag (which locked to a single
backend) with GLFW 3.4's GLFW_BUILD_WAYLAND + GLFW_BUILD_X11 flags that
build both backends and auto-select at runtime based on the available
display server. This enables the CLI thumbnail renderer to work on both
Wayland and X11 sessions without separate builds.

* wayland: Fix UI call sites that rely on global screen coordinates

On Wayland, wxGetMousePosition() returns (0,0) and SetPosition() is a
no-op for top-level windows. Fix the highest-impact call sites:

- GLCanvas3D: Use cached m_mouse.position from event handlers instead
  of wxGetMousePosition() + ScreenToClient() in get_local_mouse_position()
- Plater: Use event-relative coords via ClientToScreen(e.GetPosition())
  instead of wxGetMousePosition() in 3 leave-window handlers
- BBLTopbar: Use event.GetPosition() and FindToolByPosition() directly
  in mouse handlers instead of wxGetMousePosition()/FindToolByCurrentPosition()
- Search: Use focus-based dismiss logic on Wayland instead of
  wxGetMousePosition()-based rect checks in SearchDialog and
  SearchObjectDialog
- GUI_App: Skip SetPosition() in window_pos_restore() on Wayland where
  it is a no-op; still restore size and maximize state
- Button: Position tooltip relative to button widget via ClientToScreen
  instead of wxGetMousePosition()

* Fix SearchDialog Wayland dismiss: guard against search_line focus

* flatpak: Add Wayland socket permission for native Wayland support

* spec

* Fix crash on Wayland when wxWidgets lacks EGL support

Restore the safety fallback that forces GDK_BACKEND=x11 when wxWidgets
was not built with wxUSE_GLCANVAS_EGL=ON. Without this, the GLX backend
tries to access a non-existent X11 display on native Wayland, crashing
in wxGLCanvas::IsDisplaySupported() with SIGSEGV at offset 0xe4.

Also add a defense-in-depth guard in detect_multisample() that skips
the IsDisplaySupported call entirely on Wayland without EGL.

Root cause: deps/wxWidgets must be rebuilt after enabling EGL. The
compile-time check in OrcaSlicer.cpp detects the mismatch and falls
back safely.

* Fix EGL detection: use wxHAS_EGL instead of wxUSE_GLCANVAS_EGL

wxUSE_GLCANVAS_EGL is a CMake build option, NOT a C++ preprocessor
macro. The actual macro defined in wxWidgets setup.h is wxHAS_EGL.
All compile-time EGL checks were using the wrong macro, causing
the safety fallback to always trigger even with a properly built
EGL-enabled wxWidgets.

* Fix GL function pointers invalidated on Wayland/EGL

gladLoaderLoadGL() dlopen's libGL.so.1 to resolve GL function pointers
via dlsym, then immediately dlclose's the handle. On X11/GLX this is
fine because the GLX context keeps libGL.so mapped. On Wayland/EGL,
nothing else holds libGL.so open, so dlclose unmaps it and all function
pointers become dangling — causing SIGSEGV on the first GL call.

Fix: on Wayland, use gladLoadGL(eglGetProcAddress) which resolves
function pointers through the EGL loader without opening/closing
libGL.so.

* fix crash on start and various rendering issues

* fix crash on close

* small refactor

* move GPU selection to desktop file

* clean up a bit

* clean up more

* fix appimage error
2026-04-13 19:45:39 +08:00
2025-11-23 20:47:07 +08:00
2026-04-11 09:53:30 +08:00
2024-12-12 22:21:17 +08:00
2026-01-23 17:05:56 +08:00
2024-03-17 23:14:43 +08:00
2025-08-22 20:02:26 +08:00
2025-09-28 10:33:33 +08:00
2026-03-19 23:17:03 +08:00
2026-03-19 23:17:03 +08:00
2023-08-20 20:02:54 +08:00
2026-04-08 15:06:28 -03:00
2026-03-27 14:32:40 +08:00

OrcaSlicer logo

OrcaSlicer%2FOrcaSlicer | Trendshift

GitHub Repo stars Build all

OrcaSlicer: an open source Next-Gen Slicing Software for Precision 3D Prints.
Optimize your prints with ultra-fast slicing, intelligent support generation, and seamless printer compatibility—engineered for perfection.

Official links and community

Official Website:

OrcaSlicer.com

Github Repository:

GitHub Logo

Follow us:

X Logo

Join our Discord community:

discord logo

⚠️ CAUTION:
Several clickbait and malicious websites, such as orca-slicer[.]com and orcaslicer[.]net, are pretending to be the official OrcaSlicer site. These sites may redirect you to dangerous downloads or contain misleading information.
Our only official website is www.orcaslicer.com.

If you come across any of these in search results, please report them as unsafe or phishing to help keep the community secure with:
- Google Safe Browsing
- Microsoft Security Intelligence
- IPThreat

Main features

  • Advanced Calibration Tools
    Comprehensive suite: temperature towers, flow rate, retraction & more for optimal performance.
  • Precise Wall and Seam Control
    Adjust outer wall spacing and apply scarf seams to enhance print accuracy.
  • Sandwich Mode and Polyholes Support
    Use varied infill patterns and accurate hole shapes for improved clarity.
  • Overhang and Support Optimization
    Modify geometry for printable overhangs with precise support placement.
  • Granular Controls and Customization
    Fine-tune print speed, layer height, pressure, and temperature with precision.
  • Network Printer Support
    Seamless integration with Klipper, PrusaLink, and OctoPrint for remote control.
  • Mouse Ear Brims & Adaptive Bed Mesh
    Automatic brims and adaptive mesh calibration ensure consistent adhesion.
  • User-Friendly Interface
    Intuitive drag-and-drop design with pre-made profiles for popular printers.
  • Open-Source & Community Driven
    Regular updates fueled by continuous community contributions.
  • Wide Printer Compatibility
    Supports a broad range of printers: Bambu Lab, Prusa, Creality, Voron, and more.
  • Additional features can be found in the change notes.

Wiki

The wiki aims to provide a detailed explanation of the slicer settings, including how to maximize their use and how to calibrate and set up your printer.

Download

Stable Release

📥 Download the Latest Stable Release
Visit our GitHub Releases page for the latest stable version of OrcaSlicer, recommended for most users.

Nightly Builds

🌙 Download the Latest Nightly Build
Explore the latest developments in OrcaSlicer with our nightly builds. Feedback on these versions is highly appreciated.

How to install

Windows

Download the Windows Installer exe for your preferred version from the releases page.

Windows Package Manager

winget install --id=SoftFever.OrcaSlicer -e

Mac

  1. Download the DMG for your computer: arm64 version for Apple Silicon and x86_64 for Intel CPU.

  2. Drag OrcaSlicer.app to Application folder.

  3. If you want to run a build from a PR, you also need to follow the instructions below:

    Quarantine
    • Option 1 (You only need to do this once. After that the app can be opened normally.):

      • Step 1: Hold cmd and right click the app, from the context menu choose Open.
      • Step 2: A warning window will pop up, click Open
    • Option 2: Execute this command in terminal:

      xattr -dr com.apple.quarantine /Applications/OrcaSlicer.app
      
    • Option 3:

      • Step 1: open the app, a warning window will pop up
        mac_cant_open
      • Step 2: in System Settings -> Privacy & Security, click Open Anyway:
        mac_security_setting

Linux (Ubuntu)

  1. If you run into trouble executing it, try this command in the terminal: chmod +x /path_to_appimage/OrcaSlicer_Linux.AppImage

How to Compile

All updated build instructions for Windows, macOS, and Linux are now available on the official OrcaSlicer Wiki - How to build page.

Please refer to the wiki to ensure you're following the latest and most accurate steps for your platform.

Klipper Note

If you're running Klipper, it's recommended to add the following configuration to your printer.cfg file.

# Enable object exclusion
[exclude_object]

# Enable arcs support
[gcode_arcs]
resolution: 0.1

Supports

OrcaSlicer is an open-source project and I'm deeply grateful to all my sponsors and backers.
Their generous support enables me to purchase filaments and other essential 3D printing materials for the project.
Thank you! :)

Sponsors:

QIDI BIGTREE TECH

Backers:

Ko-fi supporters : Backers list

Support me

Some Background

Open-source slicing has always been built on a tradition of collaboration and attribution. Slic3r, created by Alessandro Ranellucci and the RepRap community, laid the foundation. PrusaSlicer by Prusa Research built on Slic3r and acknowledged that heritage. Bambu Studio in turn forked from PrusaSlicer, and SuperSlicer by @supermerill extended PrusaSlicer with community-driven enhancements. Each project carried the work of its predecessors forward, crediting those who came before.

OrcaSlicer began in that same spirit, drawing from BambuStudio, PrusaSlicer, and ideas inspired by CuraSlicer and SuperSlicer. But it has since grown far beyond its origins. Through relentless innovation — introducing advanced calibration tools, precise wall and seam control, tree supports, adaptive slicing, and hundreds of other features — OrcaSlicer has become the most widely used and actively developed open-source slicer in the 3D printing community. Many of its innovations have been adopted by other slicers, making it a driving force for the entire industry.

The OrcaSlicer logo was designed by community member Justin Levine (@freejstnalxndr).

License

  • OrcaSlicer is licensed under the GNU Affero General Public License, version 3.
  • The GNU Affero General Public License, version 3 ensures that if you use any part of this software in any way (even behind a web server), your software must be released under the same license.
  • OrcaSlicer includes a pressure advance calibration pattern test adapted from Andrew Ellis' generator, which is licensed under GNU General Public License, version 3. Ellis' generator is itself adapted from a generator developed by Sineos for Marlin, which is licensed under GNU General Public License, version 3.
  • The Bambu networking plugin is based on non-free libraries from BambuLab. It is optional to the OrcaSlicer and provides extended functionalities for Bambulab printer users.
Description
Languages
C++ 80.5%
C 10.5%
JavaScript 5.3%
HTML 1.8%
CMake 0.7%
Other 0.7%