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

2.9.0 Wayland build #13910

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ endif()

option(SLIC3R_STATIC "Compile PrusaSlicer with static libraries (Boost, TBB, glew)" ${SLIC3R_STATIC_INITIAL})
option(SLIC3R_GUI "Compile PrusaSlicer with GUI components (OpenGL, wxWidgets)" 1)
option(SLIC3R_EGL "Use EGL backend (wxWidgets, glew)" OFF)
option(SLIC3R_FHS "Assume PrusaSlicer is to be installed in a FHS directory structure" 0)
option(SLIC3R_PCH "Use precompiled headers" 1)
option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1)
Expand Down
3 changes: 2 additions & 1 deletion deps/+GLEW/GLEW.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ add_cmake_project(
SOURCE_SUBDIR build/cmake
CMAKE_ARGS
-DBUILD_UTILS=OFF
)
-DGLEW_EGL=${SLIC3R_EGL}
)
9 changes: 5 additions & 4 deletions deps/+wxWidgets/wxWidgets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(_gtk_ver 3)
endif ()
set(_wx_toolkit "-DwxBUILD_TOOLKIT=gtk${_gtk_ver}")

set(_wx_glcanvas_egl "-DwxUSE_GLCANVAS_EGL=${SLIC3R_EGL}")
endif()

set(_unicode_utf8 OFF)
Expand All @@ -28,8 +30,8 @@ else ()
endif ()

add_cmake_project(wxWidgets
URL https://github.com/prusa3d/wxWidgets/archive/323a465e577e03f330e2e6a4c78e564d125340cb.zip
URL_HASH SHA256=B538E4AD3CC93117932F4DED70C476D6650F9C70A9D4055A08F3693864C47465
URL https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.5/wxWidgets-3.2.5.tar.bz2
URL_HASH SHA256=0AD86A3AD3E2E519B6A705248FC9226E3A09BBF069C6C692A02ACF7C2D1C6B51
PATCH_COMMAND COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/webview.patch
CMAKE_ARGS
"-DCMAKE_DEBUG_POSTFIX:STRING="
Expand All @@ -51,7 +53,7 @@ add_cmake_project(wxWidgets
-DwxUSE_EXPAT=sys
-DwxUSE_LIBSDL=OFF
-DwxUSE_XTEST=OFF
-DwxUSE_GLCANVAS_EGL=OFF
${_wx_glcanvas_egl}
-DwxUSE_WEBREQUEST=OFF
${_wx_webview}
${_wx_secretstore}
Expand All @@ -68,4 +70,3 @@ if (MSVC)
"${CMAKE_CURRENT_BINARY_DIR}/builds/wxWidgets/lib/vc_x64_lib/WebView2Loader.dll"
"${${PROJECT_NAME}_DEP_INSTALL_PREFIX}/bin/WebView2Loader.dll")
endif()

10 changes: 2 additions & 8 deletions src/PrusaSlicer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ int CLI::run(int argc, char **argv)
save_main_thread_id();

#ifdef __WXGTK__
// On Linux, wxGTK has no support for Wayland, and the app crashes on
// startup if gtk3 is used. This env var has to be set explicitly to
// instruct the window manager to fall back to X server mode.
::setenv("GDK_BACKEND", "x11", /* replace */ true);

// https://github.com/prusa3d/PrusaSlicer/issues/12969
::setenv("WEBKIT_DISABLE_COMPOSITING_MODE", "1", /* replace */ false);
::setenv("WEBKIT_DISABLE_DMABUF_RENDERER", "1", /* replace */ false);
Expand Down Expand Up @@ -802,9 +797,8 @@ int CLI::run(int argc, char **argv)
#if !defined(_WIN32) && !defined(__APPLE__)
// likely some linux / unix system
const char *display = boost::nowide::getenv("DISPLAY");
// const char *wayland_display = boost::nowide::getenv("WAYLAND_DISPLAY");
//if (! ((display && *display) || (wayland_display && *wayland_display))) {
if (! (display && *display)) {
const char *wayland_display = boost::nowide::getenv("WAYLAND_DISPLAY");
if (! ((display && *display) || (wayland_display && *wayland_display))) {
// DISPLAY not set.
boost::nowide::cerr << "DISPLAY not set, GUI mode not available." << std::endl << std::endl;
this->print_help(false);
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/PhysicalPrinterDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr
// Always fill in the "printhost_port" combo box from the config and select it.
{
Choice* choice = dynamic_cast<Choice*>(m_optgroup->get_field("printhost_port"));
choice->set_values({ m_config->opt_string("printhost_port") });
choice->set_values(std::vector<std::string>({ m_config->opt_string("printhost_port") }));
choice->set_selection();
}

Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/Plater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4420,7 +4420,7 @@ void Plater::load_project(const wxString& filename)
s_multiple_beds.set_loading_project_flag(true);
ScopeGuard guard([](){ s_multiple_beds.set_loading_project_flag(false);});

if (! load_files({ into_path(filename) }).empty()) {
if (! load_files(std::vector<boost::filesystem::path>({ into_path(filename) })).empty()) {
// At least one file was loaded.
p->set_project_filename(filename);
// Save the names of active presets and project specific config into ProjectDirtyStateManager.
Expand Down