Tauri apps with blank screen on Linux
Description
Multiple times, with my desktop computer running Archlinux with bspwm
, I couldn't correctly open a Tauri app, it only showed a blank window with nothing inside.
The app seemed to function well though, because I could see the cursor change in certain areas of the blank window as if there were buttons or links, or text inputs.
The issue seemed to be purely in the graphical rendering of the app.
Simple workaround (launch from CLI)
After some research, I found a workaround, setting an environment variable to true:
WEBKIT_DISABLE_COMPOSITING_MODE=1
I'll give an example with hoppscotch-desktop
, an app like postman
, but open source and available to self host:
WEBKIT_DISABLE_COMPOSITING_MODE=1 hoppscotch-desktop
Persistent workaround (launch from GUI)
It's not very practical to run a graphical application from the terminal sometimes though (except when you want to see all the logs in real time), so I looked for a persistent solution without having to remember that variable's name every single time. That solution lies in the .desktop
file.
In the Exec=
section, you need to add, prior to the command to launch the app, env WEBKIT_DISABLE_COMPOSITING_MODE=1
.
For our current example, hoppscotch-desktop, it is like this:
[Desktop Entry]
Categories=Development,API
Comment=Desktop App for hoppscotch.io
Exec=env WEBKIT_DISABLE_COMPOSITING_MODE=1 hoppscotch-desktop
Icon=hoppscotch-desktop
Name=Hoppscotch
Terminal=false
Type=Application
MimeType=x-scheme-handler/io.hoppscotch.desktop
No Comments