mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-13 10:51:12 +00:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4dd961d5b2 | ||
|
|
4c2a63e11e | ||
|
|
f8cf34c55b | ||
|
|
d007134001 |
@@ -569,16 +569,12 @@ on the **first** call. So:
|
|||||||
#endif
|
#endif
|
||||||
```
|
```
|
||||||
|
|
||||||
**Before GTK starts**, only the environment exists. `CLI::run` (`src/OrcaSlicer.cpp`) sets the NVIDIA
|
**Before GTK starts**, only the environment exists. `CLI::run` (`src/OrcaSlicer.cpp`) branches on
|
||||||
DMABUF workaround and then branches on `GDK_BACKEND` (an `x11` prefix means the X11 opt-in). On both
|
`GDK_BACKEND` (an `x11` prefix means the X11 opt-in). On the default path it forces `GDK_BACKEND=x11`
|
||||||
paths, when `/proc/driver/nvidia/version` exists and the linked WebKitGTK honours the switch (>= 2.44,
|
when wx lacks EGL and `WAYLAND_DISPLAY` is set. It sets `WEBKIT_DISABLE_COMPOSITING_MODE=1`
|
||||||
`WebView::SupportsForceSharedMemory()`), it sets `WEBKIT_DMABUF_RENDERER_FORCE_SHM=1` and
|
(non-replacing) only when both `DISPLAY` and `WAYLAND_DISPLAY` are set, and calls `XInitThreads()`
|
||||||
`WEBKIT_FORCE_DMABUF_RENDERER=1` (non-replacing): the proprietary driver cannot back WebKit's hardware
|
|
||||||
DMABUF renderer. On the default path it forces `GDK_BACKEND=x11` when wx lacks EGL and `WAYLAND_DISPLAY`
|
|
||||||
is set. It sets `WEBKIT_DISABLE_COMPOSITING_MODE=1` (non-replacing) only when both `DISPLAY` and
|
|
||||||
`WAYLAND_DISPLAY` are set and the linked WebKitGTK is older than 2.42, and calls `XInitThreads()`
|
|
||||||
only when `DISPLAY` is set. With neither variable set, the GUI refuses to start ("Neither DISPLAY nor
|
only when `DISPLAY` is set. With neither variable set, the GUI refuses to start ("Neither DISPLAY nor
|
||||||
WAYLAND_DISPLAY set"). The details and the WebKit rules (c12912e0df) are in
|
WAYLAND_DISPLAY set"). The details and the WebKit rule (c12912e0df) are in
|
||||||
`references/webview-gl-aui-media.md` §WebKitGTK on Linux sessions.
|
`references/webview-gl-aui-media.md` §WebKitGTK on Linux sessions.
|
||||||
|
|
||||||
**wx's own detectors**, for reference:
|
**wx's own detectors**, for reference:
|
||||||
|
|||||||
@@ -61,8 +61,7 @@ available; GTK2/WebKit1 is an opt-out configuration the GUI does not support.
|
|||||||
11. A web host that re-themes in place handles `EVT_WEBVIEW_RECREATED` without `Skip()`; one that
|
11. A web host that re-themes in place handles `EVT_WEBVIEW_RECREATED` without `Skip()`; one that
|
||||||
needs a reload lets it through. §[Orca wrapper](#orca-webview-wrapper-widgetswebview)
|
needs a reload lets it through. §[Orca wrapper](#orca-webview-wrapper-widgetswebview)
|
||||||
12. Keep `WebViewWebKit`'s destructor removing the `"wx"` handler. §[Orca wrapper](#orca-webview-wrapper-widgetswebview)
|
12. Keep `WebViewWebKit`'s destructor removing the `"wx"` handler. §[Orca wrapper](#orca-webview-wrapper-widgetswebview)
|
||||||
13. Do not widen `WEBKIT_DISABLE_COMPOSITING_MODE` beyond Orca's default-path XWayland case for
|
13. Do not widen `WEBKIT_DISABLE_COMPOSITING_MODE` beyond Orca's default-path XWayland case, and never
|
||||||
WebKitGTK older than 2.42, and never
|
|
||||||
make a page's progress depend only on a C++→JS callback. §[WebKitGTK on Linux](#webkitgtk-on-linux-sessions)
|
make a page's progress depend only on a C++→JS callback. §[WebKitGTK on Linux](#webkitgtk-on-linux-sessions)
|
||||||
14. GL attribute lists: legacy `int[]` lists end with `0` and spell out `WX_GL_RGBA` and
|
14. GL attribute lists: legacy `int[]` lists end with `0` and spell out `WX_GL_RGBA` and
|
||||||
`WX_GL_DOUBLEBUFFER`; `wxGLAttributes`/`wxGLContextAttrs` end with `EndList()`; MSAA is requested
|
`WX_GL_DOUBLEBUFFER`; `wxGLAttributes`/`wxGLContextAttrs` end with `EndList()`; MSAA is requested
|
||||||
@@ -568,66 +567,33 @@ vue-resize workaround script and sets a persistent SQLite cookie store on the vi
|
|||||||
## WebKitGTK on Linux sessions
|
## WebKitGTK on Linux sessions
|
||||||
|
|
||||||
**Mechanism.** `CLI::run` (`src/OrcaSlicer.cpp`, under `#ifdef __WXGTK__`, before GTK initialises)
|
**Mechanism.** `CLI::run` (`src/OrcaSlicer.cpp`, under `#ifdef __WXGTK__`, before GTK initialises)
|
||||||
sets the NVIDIA DMABUF workaround and then branches on `GDK_BACKEND`:
|
branches on `GDK_BACKEND`:
|
||||||
- **Both paths**, before the split: when `/proc/driver/nvidia/version` exists and the linked WebKitGTK
|
|
||||||
honours the switch (>= 2.44, `WebView::SupportsForceSharedMemory()`), it sets
|
|
||||||
`WEBKIT_DMABUF_RENDERER_FORCE_SHM=1` and `WEBKIT_FORCE_DMABUF_RENDERER=1` non-replacing. The
|
|
||||||
proprietary driver cannot back WebKit's hardware DMABUF renderer, so the shared-memory transport keeps
|
|
||||||
accelerated compositing instead of dropping it; `WEBKIT_FORCE_DMABUF_RENDERER` clears the
|
|
||||||
Debian/Ubuntu/openSUSE `isNVIDIA()` early return, which otherwise returns before the FORCE_SHM check.
|
|
||||||
- **Default path** (`GDK_BACKEND` unset or not starting with `x11`): if wx lacks EGL (`!wxHAS_EGL`) and
|
- **Default path** (`GDK_BACKEND` unset or not starting with `x11`): if wx lacks EGL (`!wxHAS_EGL`) and
|
||||||
`WAYLAND_DISPLAY` is set, it forces `GDK_BACKEND=x11`; it sets `WEBKIT_DISABLE_COMPOSITING_MODE=1`
|
`WAYLAND_DISPLAY` is set, it forces `GDK_BACKEND=x11`; it sets `WEBKIT_DISABLE_COMPOSITING_MODE=1`
|
||||||
non-replacing **only** when the linked WebKitGTK predates 2.42 (`WebView::NeedsCompositingWorkaround()`)
|
non-replacing **only** when both `DISPLAY` and `WAYLAND_DISPLAY` are non-empty (a Wayland session with
|
||||||
**and** both `DISPLAY` and `WAYLAND_DISPLAY` are non-empty (a Wayland session with
|
|
||||||
XWayland available — the session, not the backend GTK will pick); `XInitThreads()` runs only when
|
XWayland available — the session, not the backend GTK will pick); `XInitThreads()` runs only when
|
||||||
`DISPLAY` is set.
|
`DISPLAY` is set.
|
||||||
- **`GDK_BACKEND=x11…` opt-in path**: sets `DRI_PRIME=1` (and the NVIDIA PRIME variables when
|
- **`GDK_BACKEND=x11…` opt-in path**: sets `DRI_PRIME=1` (and the NVIDIA PRIME variables when
|
||||||
`/proc/driver/nvidia/version` exists), calls `XInitThreads()`, and deliberately does **not** disable
|
`/proc/driver/nvidia/version` exists), calls `XInitThreads()`, and deliberately does **not** disable
|
||||||
compositing, which keeps hardware acceleration for Device / Setup Wizard / login pages.
|
compositing (the comment: the WebKit2GTK XWayland bug appears fixed in WebKit2GTK ≥ 2.42, and leaving
|
||||||
|
compositing on keeps hardware acceleration for Device / Setup Wizard / login pages).
|
||||||
|
|
||||||
Runtime backend detection elsewhere uses Orca's `is_running_on_wayland()` / `is_running_on_x11()`
|
Runtime backend detection elsewhere uses Orca's `is_running_on_wayland()` / `is_running_on_x11()`
|
||||||
(see `references/platforms.md`), not these environment variables.
|
(see `references/platforms.md`), not these environment variables.
|
||||||
|
|
||||||
**Pitfall.**
|
**Pitfall.**
|
||||||
- **Rule:** On NVIDIA reach for `WEBKIT_DMABUF_RENDERER_FORCE_SHM` before
|
|
||||||
`WEBKIT_DISABLE_COMPOSITING_MODE`. **Why:** the proprietary driver cannot back WebKit's hardware
|
|
||||||
DMABUF renderer, leaving web views blank or slow; FORCE_SHM keeps accelerated compositing and only
|
|
||||||
skips the hardware path, while disabling compositing drops it. Threaded scrolling is a separate,
|
|
||||||
release-dependent default (off in 2.44/2.45, on from 2.46). `WEBKIT_DISABLE_DMABUF_RENDERER` is not a
|
|
||||||
substitute — it is read first, leaves the transport set empty (no compositing from 2.44 on, where the
|
|
||||||
X11/Wayland fallback renderers were removed) and has a reported crash path. On Debian/Ubuntu and
|
|
||||||
openSUSE the `isNVIDIA()` patch returns before the FORCE_SHM check, so `WEBKIT_FORCE_DMABUF_RENDERER=1`
|
|
||||||
must clear it first; that variable exists only in those patches. WebKit reads all of these once per
|
|
||||||
process, before the first WebView.
|
|
||||||
The test is `/proc/driver/nvidia/version`, so a hybrid laptop that renders on its iGPU also takes the
|
|
||||||
shared-memory path, which is a per-frame GPU readback rather than zero-copy; exporting
|
|
||||||
`WEBKIT_DMABUF_RENDERER_FORCE_SHM=0` in the environment restores the hardware path.
|
|
||||||
```cpp
|
|
||||||
// Wrong: kills compositing and threaded scrolling (and can crash on modern WebKit)
|
|
||||||
::setenv("WEBKIT_DISABLE_DMABUF_RENDERER", "1", false);
|
|
||||||
// Right: keep compositing, skip only the hardware DMABUF path
|
|
||||||
if (::access("/proc/driver/nvidia/version", F_OK) == 0 && WebView::SupportsForceSharedMemory()) {
|
|
||||||
::setenv("WEBKIT_DMABUF_RENDERER_FORCE_SHM", "1", /*replace*/ false);
|
|
||||||
::setenv("WEBKIT_FORCE_DMABUF_RENDERER", "1", /*replace*/ false);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
Cite: WebKit 2.52.6 `Source/WebKit/UIProcess/gtk/AcceleratedBackingStore.cpp`
|
|
||||||
(`rendererBufferTransportMode()`), Debian `disable-nvidia-dmabuf.patch`, WebKit bug 262607.
|
|
||||||
- **Rule:** Set `WEBKIT_DISABLE_COMPOSITING_MODE` only on the default path in Wayland sessions,
|
- **Rule:** Set `WEBKIT_DISABLE_COMPOSITING_MODE` only on the default path in Wayland sessions,
|
||||||
non-replacing (`setenv(..., false)`, so a value the user already exported wins), before GTK
|
non-replacing (`setenv(..., false)`, so a value the user already exported wins), before GTK
|
||||||
initialises; never unconditionally, and only for the WebKitGTK releases that need it (older than
|
initialises; never unconditionally. Keep JS-side fallbacks so a page never
|
||||||
2.42, `WebView::NeedsCompositingWorkaround()`). Keep JS-side fallbacks so a page never
|
|
||||||
waits forever for a C++→JS call.
|
waits forever for a C++→JS call.
|
||||||
**Why:** WebKit2GTK accelerated compositing could fail silently under XWayland before 2.42, leaving
|
**Why:** WebKit2GTK accelerated compositing could fail silently under XWayland, leaving web views
|
||||||
web views blank (Setup Wizard stuck on "Loading..."); the variable also turns off threaded scrolling,
|
blank (Setup Wizard stuck on "Loading..."); disabling it everywhere needlessly drops hardware
|
||||||
so applying it on a newer WebKit needlessly drops both GPU compositing and async scrolling (the
|
acceleration; without the JS timeout the user is stuck when the signal is lost.
|
||||||
Device tab loses its smoothness); without the JS timeout the user is stuck when the signal is lost.
|
|
||||||
```cpp
|
```cpp
|
||||||
// Wrong: unconditional, kills HW acceleration everywhere
|
// Wrong: unconditional, kills HW acceleration everywhere
|
||||||
::setenv("WEBKIT_DISABLE_COMPOSITING_MODE", "1", false);
|
::setenv("WEBKIT_DISABLE_COMPOSITING_MODE", "1", false);
|
||||||
// Right (default path only): non-replacing, before GTK init, WebKitGTK < 2.42,
|
// Right (default path only): non-replacing, before GTK init, Wayland session with XWayland
|
||||||
// Wayland session with XWayland
|
if (display && *display && wayland && *wayland)
|
||||||
if (WebView::NeedsCompositingWorkaround() && display && *display && wayland && *wayland)
|
|
||||||
::setenv("WEBKIT_DISABLE_COMPOSITING_MODE", "1", /*replace*/ false);
|
::setenv("WEBKIT_DISABLE_COMPOSITING_MODE", "1", /*replace*/ false);
|
||||||
```
|
```
|
||||||
Cite: c12912e0df (`src/OrcaSlicer.cpp`; `resources/web/guide/0/load.js` `OnInit`
|
Cite: c12912e0df (`src/OrcaSlicer.cpp`; `resources/web/guide/0/load.js` `OnInit`
|
||||||
|
|||||||
@@ -7478,7 +7478,7 @@ msgid "Update"
|
|||||||
msgstr "更新"
|
msgstr "更新"
|
||||||
|
|
||||||
msgid "Assistant(HMS)"
|
msgid "Assistant(HMS)"
|
||||||
msgstr "助理(HMS)"
|
msgstr "助手(HMS)"
|
||||||
|
|
||||||
#, c-format, boost-format
|
#, c-format, boost-format
|
||||||
msgid "Network plug-in v%s"
|
msgid "Network plug-in v%s"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
# WebKit's NVIDIA DMABUF workaround (gnome-build-meta#754) is applied by the
|
# Work-around https://gitlab.gnome.org/GNOME/gnome-build-meta/-/issues/754
|
||||||
# binary itself, gated on the runtime WebKitGTK version (src/OrcaSlicer.cpp).
|
grep -q org.freedesktop.Platform.GL.nvidia /.flatpak-info && export WEBKIT_DISABLE_DMABUF_RENDERER=1
|
||||||
|
|
||||||
# Work-around https://github.com/bambulab/BambuStudio/issues/3440
|
# Work-around https://github.com/bambulab/BambuStudio/issues/3440
|
||||||
# Use LC_NUMERIC instead of LC_ALL to prevent decimal separator issues
|
# Use LC_NUMERIC instead of LC_ALL to prevent decimal separator issues
|
||||||
|
|||||||
+8
-18
@@ -161,7 +161,6 @@ using json = nlohmann::json;
|
|||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#endif
|
#endif
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "slic3r/GUI/Widgets/WebView.hpp"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SLIC3R_GUI
|
#ifdef SLIC3R_GUI
|
||||||
@@ -1154,9 +1153,8 @@ int CLI::run(int argc, char **argv)
|
|||||||
// opt-in path. The ~2020-era WebKit2GTK XWayland compositor bug it
|
// opt-in path. The ~2020-era WebKit2GTK XWayland compositor bug it
|
||||||
// worked around appears fixed in WebKit2GTK >= 2.42; leaving it
|
// worked around appears fixed in WebKit2GTK >= 2.42; leaving it
|
||||||
// unset preserves WebKit hardware acceleration on Device / Setup
|
// unset preserves WebKit hardware acceleration on Device / Setup
|
||||||
// Wizard / login / store. The default path applies it only on
|
// Wizard / login / store. The default path still applies it on
|
||||||
// XWayland sessions and only when the linked WebKitGTK predates the
|
// XWayland sessions as a conservative fallback for older WebKit.
|
||||||
// fix (< 2.42), as a conservative fallback for older WebKit.
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
const char* gdk_backend = ::getenv("GDK_BACKEND");
|
const char* gdk_backend = ::getenv("GDK_BACKEND");
|
||||||
@@ -1164,14 +1162,6 @@ int CLI::run(int argc, char **argv)
|
|||||||
// honours the first backend in the comma-separated list).
|
// honours the first backend in the comma-separated list).
|
||||||
const bool x11_opt_in = gdk_backend && boost::starts_with(gdk_backend, "x11");
|
const bool x11_opt_in = gdk_backend && boost::starts_with(gdk_backend, "x11");
|
||||||
|
|
||||||
// NVIDIA's proprietary driver cannot back WebKitGTK's DMABUF renderer.
|
|
||||||
// Force the shared-memory transport, which keeps compositing and threaded
|
|
||||||
// scrolling; the second variable clears Debian/Ubuntu/openSUSE's isNVIDIA().
|
|
||||||
if (::access("/proc/driver/nvidia/version", F_OK) == 0 && WebView::SupportsForceSharedMemory()) {
|
|
||||||
::setenv("WEBKIT_DMABUF_RENDERER_FORCE_SHM", "1", /* replace */ false);
|
|
||||||
::setenv("WEBKIT_FORCE_DMABUF_RENDERER", "1", /* replace */ false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (x11_opt_in) {
|
if (x11_opt_in) {
|
||||||
// ===== X11 / XWayland (opted in via GDK_BACKEND=x11) =====
|
// ===== X11 / XWayland (opted in via GDK_BACKEND=x11) =====
|
||||||
BOOST_LOG_TRIVIAL(info) << "GDK_BACKEND=x11 detected; applying v2.3.2 X11/XWayland workarounds.";
|
BOOST_LOG_TRIVIAL(info) << "GDK_BACKEND=x11 detected; applying v2.3.2 X11/XWayland workarounds.";
|
||||||
@@ -1215,15 +1205,15 @@ int CLI::run(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// WebKit2GTK accelerated compositing could fail under XWayland
|
// WebKit2GTK compositing can fail under XWayland on older
|
||||||
// on WebKit releases before 2.42. Disable it only then, and only
|
// WebKit releases. Disable it only when both DISPLAY and
|
||||||
// when both DISPLAY and WAYLAND_DISPLAY are set (an XWayland
|
// WAYLAND_DISPLAY are set (i.e. an XWayland session is in
|
||||||
// session). Disabling it also turns off threaded scrolling, so on
|
// use). On pure X11 or native Wayland, compositing is left
|
||||||
// newer WebKit it only costs performance.
|
// enabled so WebKit retains HW acceleration.
|
||||||
{
|
{
|
||||||
const char* display_env_wk = ::getenv("DISPLAY");
|
const char* display_env_wk = ::getenv("DISPLAY");
|
||||||
const char* wayland_env_wk = ::getenv("WAYLAND_DISPLAY");
|
const char* wayland_env_wk = ::getenv("WAYLAND_DISPLAY");
|
||||||
if (WebView::NeedsCompositingWorkaround() && display_env_wk && *display_env_wk && wayland_env_wk && *wayland_env_wk) {
|
if (display_env_wk && *display_env_wk && wayland_env_wk && *wayland_env_wk) {
|
||||||
::setenv("WEBKIT_DISABLE_COMPOSITING_MODE", "1", /* replace */ false);
|
::setenv("WEBKIT_DISABLE_COMPOSITING_MODE", "1", /* replace */ false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -429,8 +429,7 @@ if [ "\$XDG_SESSION_TYPE" = "wayland" ] && [ "\$ZINK_DISABLE_OVERRIDE" != "1" ];
|
|||||||
export __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json
|
export __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json
|
||||||
export MESA_LOADER_DRIVER_OVERRIDE=zink
|
export MESA_LOADER_DRIVER_OVERRIDE=zink
|
||||||
export GALLIUM_DRIVER=zink
|
export GALLIUM_DRIVER=zink
|
||||||
# WebKit's NVIDIA DMABUF workaround is applied by the binary itself,
|
export WEBKIT_DISABLE_DMABUF_RENDERER=1
|
||||||
# gated on the runtime WebKitGTK version (src/OrcaSlicer.cpp).
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1729,8 +1729,8 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
|||||||
//plate->pattern_file = it->second->pattern_file;
|
//plate->pattern_file = it->second->pattern_file;
|
||||||
plate->no_light_thumbnail_file = it->second->no_light_thumbnail_file;
|
plate->no_light_thumbnail_file = it->second->no_light_thumbnail_file;
|
||||||
plate->top_file = it->second->top_file;
|
plate->top_file = it->second->top_file;
|
||||||
plate->pick_file = it->second->pick_file.empty();
|
plate->pick_file = it->second->pick_file;
|
||||||
plate->pattern_bbox_file = it->second->pattern_bbox_file.empty();
|
plate->pattern_bbox_file = it->second->pattern_bbox_file;
|
||||||
plate->config = it->second->config;
|
plate->config = it->second->config;
|
||||||
|
|
||||||
if (!plate->thumbnail_file.empty())
|
if (!plate->thumbnail_file.empty())
|
||||||
|
|||||||
@@ -3295,7 +3295,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
|||||||
m_is_role_based_fan_on.fill(false);
|
m_is_role_based_fan_on.fill(false);
|
||||||
m_role_based_fan_marker_layer.fill(-1);
|
m_role_based_fan_marker_layer.fill(-1);
|
||||||
|
|
||||||
m_fan_mover.release();
|
m_fan_mover.reset();
|
||||||
m_ordering_cache.clear();
|
m_ordering_cache.clear();
|
||||||
|
|
||||||
// Belt printer: initialize belt-specific writer via virtual hook.
|
// Belt printer: initialize belt-specific writer via virtual hook.
|
||||||
|
|||||||
@@ -3232,9 +3232,16 @@ bool GUI_App::on_init_inner()
|
|||||||
#ifdef _MSW_DARK_MODE
|
#ifdef _MSW_DARK_MODE
|
||||||
|
|
||||||
#ifndef __WINDOWS__
|
#ifndef __WINDOWS__
|
||||||
|
// The label colours and the dark mode flag were set above from the saved mode. When the system theme
|
||||||
|
// differs from it, refresh them, or dialogs that map their colours stay in the old mode for this session.
|
||||||
|
const bool saved_dark_mode = dark_mode();
|
||||||
wxSystemAppearance app = wxSystemSettings::GetAppearance();
|
wxSystemAppearance app = wxSystemSettings::GetAppearance();
|
||||||
GUI::wxGetApp().app_config->set("dark_color_mode", app.IsDark() ? "1" : "0");
|
GUI::wxGetApp().app_config->set("dark_color_mode", app.IsDark() ? "1" : "0");
|
||||||
GUI::wxGetApp().app_config->save();
|
GUI::wxGetApp().app_config->save();
|
||||||
|
if (dark_mode() != saved_dark_mode) {
|
||||||
|
init_label_colours();
|
||||||
|
Update_dark_mode_flag();
|
||||||
|
}
|
||||||
#endif // __APPLE__
|
#endif // __APPLE__
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -69,10 +69,6 @@ webkit_web_view_run_javascript_finish (WebKitWebView
|
|||||||
GError **error);
|
GError **error);
|
||||||
WEBKIT_API void
|
WEBKIT_API void
|
||||||
webkit_javascript_result_unref (WebKitJavascriptResult *js_result);
|
webkit_javascript_result_unref (WebKitJavascriptResult *js_result);
|
||||||
WEBKIT_API guint
|
|
||||||
webkit_get_major_version (void);
|
|
||||||
WEBKIT_API guint
|
|
||||||
webkit_get_minor_version (void);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -405,29 +401,6 @@ bool WebView::NeedsRecreateOnShow()
|
|||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebView::NeedsCompositingWorkaround()
|
|
||||||
{
|
|
||||||
#ifdef __linux__
|
|
||||||
const guint major = webkit_get_major_version();
|
|
||||||
const guint minor = webkit_get_minor_version();
|
|
||||||
return major < 2 || (major == 2 && minor < 42);
|
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
bool WebView::SupportsForceSharedMemory()
|
|
||||||
{
|
|
||||||
#ifdef __linux__
|
|
||||||
const guint major = webkit_get_major_version();
|
|
||||||
const guint minor = webkit_get_minor_version();
|
|
||||||
return major > 2 || (major == 2 && minor >= 44);
|
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#if wxUSE_WEBVIEW_EDGE
|
#if wxUSE_WEBVIEW_EDGE
|
||||||
bool WebView::CheckWebViewRuntime()
|
bool WebView::CheckWebViewRuntime()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,16 +30,6 @@ public:
|
|||||||
// ignoring every navigation. A panel that gets true here recreates its view on first Show().
|
// ignoring every navigation. A panel that gets true here recreates its view on first Show().
|
||||||
static bool NeedsRecreateOnShow();
|
static bool NeedsRecreateOnShow();
|
||||||
|
|
||||||
// True when the linked WebKitGTK predates 2.42, where accelerated compositing
|
|
||||||
// could fail silently on XWayland sessions, so it is forced off as a fallback.
|
|
||||||
// False on every other platform. Safe to call before GTK initialises.
|
|
||||||
static bool NeedsCompositingWorkaround();
|
|
||||||
|
|
||||||
// True when the linked WebKitGTK is new enough (>= 2.44) to honour
|
|
||||||
// WEBKIT_DMABUF_RENDERER_FORCE_SHM, the shared-memory transport switch.
|
|
||||||
// False on every other platform. Safe to call before GTK initialises.
|
|
||||||
static bool SupportsForceSharedMemory();
|
|
||||||
|
|
||||||
static void RecreateAll();
|
static void RecreateAll();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2043,3 +2043,40 @@ TEST_CASE("3MF XML entries declaring more than an int can hold fail to load", "[
|
|||||||
CHECK_FALSE(parser.check_3mf_from_prusa(path));
|
CHECK_FALSE(parser.check_3mf_from_prusa(path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("Loading a gcode.3mf from a stream keeps the plate's pick and pattern file paths", "[3mf][Regression]")
|
||||||
|
{
|
||||||
|
Model model;
|
||||||
|
REQUIRE(load_stl((std::string(TEST_DATA_DIR) + "/test_3mf/Prusa.stl").c_str(), &model));
|
||||||
|
model.add_default_instances();
|
||||||
|
ScopedTemporaryDir backup_dir("orca_pick");
|
||||||
|
model.set_backup_path(backup_dir.string());
|
||||||
|
DynamicPrintConfig config = DynamicPrintConfig::full_print_config();
|
||||||
|
|
||||||
|
auto plate = std::make_unique<PlateData>();
|
||||||
|
plate->plate_index = 0;
|
||||||
|
plate->pick_file = (backup_dir.path() / "pick.png").string();
|
||||||
|
plate->pattern_bbox_file = (backup_dir.path() / "plate.json").string();
|
||||||
|
|
||||||
|
ScopedTemporaryFile temp(".3mf");
|
||||||
|
const std::string test_file = temp.string();
|
||||||
|
StoreParams store_params;
|
||||||
|
store_params.path = test_file.c_str();
|
||||||
|
store_params.model = &model;
|
||||||
|
store_params.config = &config;
|
||||||
|
store_params.plate_data_list.push_back(plate.get());
|
||||||
|
store_params.strategy = SaveStrategy::Zip64 | SaveStrategy::Silence;
|
||||||
|
REQUIRE(store_bbs_3mf(store_params));
|
||||||
|
|
||||||
|
boost::nowide::ifstream in(test_file, std::ios::binary);
|
||||||
|
Model dst_model;
|
||||||
|
DynamicPrintConfig dst_config;
|
||||||
|
PlateDataPtrs dst_plates;
|
||||||
|
Semver file_version;
|
||||||
|
dst_model.set_backup_path(backup_dir.string());
|
||||||
|
REQUIRE(load_gcode_3mf_from_stream(in, &dst_config, &dst_model, &dst_plates, &file_version));
|
||||||
|
REQUIRE(dst_plates.size() == 1);
|
||||||
|
CHECK(dst_plates.front()->pick_file == "Metadata/pick_1.png");
|
||||||
|
CHECK(dst_plates.front()->pattern_bbox_file == "Metadata/plate_1.json");
|
||||||
|
release_PlateData_list(dst_plates);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user