Saltar al contenido principal

JusPrin on Linux: fix a garbled 3D view or a frozen window on Wayland

· 5 min de lectura

You open JusPrin on Linux. The AI panel looks fine, but the 3D view of the plate is drawn wrong: it looks folded in half, or part of it is painted over other parts of the window. After a while the window stops responding to the mouse. Classic view can be worse.

If your desktop runs on Wayland, this is a known problem with the component that draws web pages inside the app, and one setting fixes it. Start JusPrin like this:

WEBKIT_DMABUF_RENDERER_FORCE_SHM=1 ~/Downloads/JusPrin_Linux_AppImage_Ubuntu2404_V2.0.1.AppImage

Change the path to wherever you saved the AppImage. The rest of this page explains how to check that this is your problem, how to make the fix permanent, what to try if it doesn't help, and why it happens.

Who this affects​

  • You run a Wayland session. Most current GNOME and KDE desktops do by default, including Ubuntu, Fedora and Debian.
  • You run JusPrin's AppImage. JusPrin 2.0.1 ships one Linux download, an x86_64 AppImage built on Ubuntu 24.04. It uses your system's own WebKitGTK and graphics drivers rather than bundled copies, so whether you hit this depends on your distribution's versions.
  • Your graphics driver and WebKitGTK version don't get along. The combinations reported so far are Ubuntu's WebKitGTK 2.52 with Intel graphics, and Debian's WebKitGTK 2.54 with AMD graphics. A JusPrin user on AMD graphics and Wayland reported the folded 3D view and the unresponsive window.

Two groups are already covered in JusPrin 2.0.1 and shouldn't see this: computers with NVIDIA's own (proprietary) driver, and Linux running in a virtual machine. JusPrin turns the setting on by itself in both cases.

Step 1: check that you're on Wayland​

Open a terminal and run:

echo $XDG_SESSION_TYPE

If it prints wayland, read on. If it prints x11, this page isn't about your problem. Use Help › Report a problem… in JusPrin instead, as described at the end of this page.

Step 2: start JusPrin with the setting​

Make the AppImage runnable once, if you haven't already:

chmod +x ~/Downloads/JusPrin_Linux_AppImage_Ubuntu2404_V2.0.1.AppImage

Then start it with the setting in front:

WEBKIT_DMABUF_RENDERER_FORCE_SHM=1 ~/Downloads/JusPrin_Linux_AppImage_Ubuntu2404_V2.0.1.AppImage

Open a project and move the mouse over the 3D view, including over the print issues button at its bottom right. The view should draw normally, and the window should keep taking clicks. The user who reported the problem confirmed that this fixed it.

The setting applies only to JusPrin started from that command. It changes nothing else on your computer.

Step 3: make it permanent with a launcher​

Typing the command every time gets old. A launcher file adds JusPrin to your desktop's app list with the setting built in.

Create the file ~/.local/share/applications/jusprin.desktop with this content, changing the path on the Exec line to where your AppImage is:

[Desktop Entry]
Type=Application
Name=JusPrin
Comment=AI slicer for 3D printing
Exec=env WEBKIT_DMABUF_RENDERER_FORCE_SHM=1 /home/YOUR_NAME/Applications/JusPrin_Linux_AppImage_Ubuntu2404_V2.0.1.AppImage %F
Terminal=false
Categories=Graphics;3DGraphics;

The path must be a full path starting with /; launchers don't understand ~. JusPrin then shows up in your app menu, and starting it from there uses the setting.

When you update JusPrin, the AppImage's file name changes with the version, so update the Exec line too.

If it doesn't help​

Check your WebKitGTK version​

WebKitGTK 2.42 and 2.43 have the same problem but ignore WEBKIT_DMABUF_RENDERER_FORCE_SHM. Find your version:

# Ubuntu and Debian
dpkg -s libwebkit2gtk-4.1-0 | grep Version

# Fedora
rpm -q webkit2gtk4.1

If it says 2.42 or 2.43, use this setting instead. It turns off the web view's accelerated drawing altogether:

WEBKIT_DISABLE_COMPOSITING_MODE=1 ~/Downloads/JusPrin_Linux_AppImage_Ubuntu2404_V2.0.1.AppImage

Run JusPrin through X11 instead​

If neither setting helps, run the whole window through XWayland, the X11 compatibility layer that Wayland desktops include:

GDK_BACKEND=x11 ~/Downloads/JusPrin_Linux_AppImage_Ubuntu2404_V2.0.1.AppImage

This avoids the Wayland drawing path entirely. Use it as a last resort, because the window then isn't a native Wayland window.

Why it happens​

Much of JusPrin's screen is a web page drawn inside the app: the AI panel, Home, Preferences and the printer windows. On Linux that drawing is done by WebKitGTK, the same engine GNOME's web browser uses.

On Wayland, WebKitGTK normally hands each finished frame to the app by sharing it directly in graphics memory, a method called DMA-BUF. With some combinations of graphics driver and WebKitGTK version, that hand-over goes wrong. The web pages and the 3D view end up drawn over each other, which is why the 3D view looks folded or painted over, and the window can stop handling input.

WEBKIT_DMABUF_RENDERER_FORCE_SHM=1 tells WebKitGTK to pass frames through ordinary shared memory instead. Drawing stays accelerated, and the hand-over that breaks is skipped. OrcaSlicer, which JusPrin is built on, already used this setting on NVIDIA's driver and in virtual machines.

When you won't need the setting any more​

The OrcaSlicer team fixed this in OrcaSlicer pull request #17399. The app now turns the setting on by itself in every Wayland session outside the Flatpak version, and uses the compositing switch on WebKitGTK 2.42 and 2.43. We've added that fix to JusPrin. It isn't in JusPrin 2.0.1; it will be in the next release.

After you update, you can drop the setting from your command or launcher. Keeping it does no harm: when you set it yourself, JusPrin leaves your value alone.

Get the newest JusPrin from the download page. JusPrin also tells you about new versions in Preferences › Updates.

Still broken? Tell us​

Choose Report a problem… in JusPrin's Help menu. It opens a GitHub issue with your JusPrin version filled in. Please add:

  • what echo $XDG_SESSION_TYPE printed;
  • your WebKitGTK version, from the commands above;
  • your distribution and graphics card;
  • which of the settings on this page you tried, and what each one changed;
  • a screenshot of the broken view.

You can also write to jusprin-support@obico.io.

New to JusPrin? It's a free, open-source slicer built on OrcaSlicer, with AI that changes the settings for you. Read the JusPrin 2 announcement.