The Obsidian package on Flathub defaults to Electron 32 now, which fixes the problem it used to have in Wayland mode. Also, should one want to run it in X11 mode for any reason, Fedora 41 released with GNOME 47, enabling its new xwayland-native-scaling
feature, that finally makes XWayland apps crisp in fractional scaling scenarios. For all intents and purposes, either of these two advancements obsolete this gist.
Obsidian has had a long-standing bug open for a couple years now. The problem with this bug is that, when Obsidian is running in Wayland mode, it is not possible to drag tabs around, tile them, or move them around in any way. The only way to restore this functionality is to run Obsidian in X11 mode, through XWayland. Sadly, doing that degrades the experience on HiDPI setups with fractional scaling enabled, because fonts become very fuzzy to read.
Here, I am posting the workaround I found. There seems to be a mitigation to this bug in Electron version 32. Obsidian still appears to use Electron 30, which is too old. While chatting about this with other Obsidian users, I was directed to trying to use the ArchLinux package, hence, I used Distrobox to create a local Arch Linux container to play with.
Nothing is more permanent than a temporary solution, but this truly is just a temporary solution. Eventually, Obsidian will get around to updating their own build with a more current version of Electron. Until then, taking advantage of Arch's very modular packaging seems to be a pretty easy way to have something working for now.
First, create a home directory for your Arch Linux container. In my case, I chose ~/distrobox/archbox
mkdir -p ~/distrobox/archbox
We want to mount this folder as $HOME
in the container to avoid breakage and to prevent the Arch system from rewriting configuration files already present on your host system.
Then, clone the distrobox.ini
file from this gist into any unique folder you want (I used the container's homedir) and run distrobox assemble create
. Make sure to change nvidia=false
to nvidia=true
if you are using a NVidia GPU with the proprietary driver as your primary GPU.
This will create an Arch Linux container with a home directory mounted to the folder we just created, with a bunch of packages we will need already installed.
Our goal is to patch the official package to change the launch script that gets placed in /usr/bin/obsidian
replacing electron30
with electron32
.
Let's spawn a shell inside our container:
distrobox enter archbox
Then, cd
to a suitable location and download the package source from the ABS:
pkgctl repo clone --protocol=https --switch 1.6.7-1 obsidian
You should replace --switch 1.6.7-1
with a more current version, or remove it entirely to install the latest version. I decided to leave it in the gist to give a baseline of what will surely work, but I encourage trying to patch the newest version first. It should be pretty easy to re-do what I did for a newer version if my specific patch file ever breaks.
Then, navigate to the obsidian
folder. Drop inside the electron32.patch
file from this gist and then patch the repo, then make and install the package
cd obsidian
cp path/to/electron32.patch .
git apply electron32.patch
makepkg --install
Next, we want to export the desktop file. This can be done with
distrobox-export --app obsidian
A new Obsidian icon should now appear in the apps list in your host system. If all went well, opening Obsidian from that icon should lead us to the Arch Obsidian build, running with electron32. This specific combination - Obsidian1.6.7-1 with electron32 - seems to work great on Wayland.