For those who use Snaps like Discord and Element, and prefer not to call it from its system tray icon, you might notice that after having opened and closed the window of the currently running instance a few times, it will just restart. This is incorrect behavior, as other versions like the .deb
it is based on do not behave this way.
To be more specific, let’s say we installed Discord’s .deb
package and opened discord
from a terminal. Then, we open another terminal and also enter discord
, which basically simulates what happens when you click the desktop icon again. It outputs:
Discord 0.0.24
Quitting secondary instance.
And then focuses back on the previously opened window, without opening or doing anything else. This is intended behavior and is what also happens on the Flatpak version of Discord (I can’t comment on other versions). You can repeat the discord
command as many times as you would like, and it will always output this.
However, if we were to take the Discord Snap and try the same thing, we would get a similar output at first, albeit with some likely sandbox related errors:
Discord 0.0.24
Quitting secondary instance.
Gtk-Message: 19:52:02.243: Failed to load module "xapp-gtk3-module"
(Discord:118179): Gtk-WARNING **: 19:52:02.278: Theme parsing error: gtk.css:1:21: Failed to import: Error opening file /home/constancies/snap/discord/149/.config/gtk-3.0/colors.css: No such file or directory
Gtk-Message: 19:52:02.307: Failed to load module "colorreload-gtk-module"
Gtk-Message: 19:52:02.307: Failed to load module "window-decorations-gtk-module"
But after the fourth or so time of doing this (though it sometimes varies how many instances it takes to trigger this), the app will open in a new instance, replacing the currently running one, which I imagine would be very annoying for someone in a voice call!
A similar thing occurs with the element-desktop
Snap. Initially running element-desktop
with an instance already running returns:
/home/constancies/snap/element-desktop/47/.config/Element exists: yes
/home/constancies/snap/element-desktop/47/.config/Riot exists: no
Other instance detected: exiting
But after a couple times of running element-desktop
from that separate terminal, the app will restart.
I’ve also tested running the apps via running /snap/bin/[the app]
, or snap run [the app
], and they both have the exact same results.
So, what exactly might be causing this? It’s a pretty inconvenient bug, and I’d quite like to help find a way to address it since the Discord Snap would be virtually perfect in my eyes without it.
Thanks.