Using Wayland, different applications from the same flatpak are treated as the same application
Feature summary
Several flatpaks include multiple applications under a shared prefix. For example, LibreOffice includes org.libreoffice.LibreOffice.writer
, org.libreoffice.LibreOffice.draw
, and several others.
In #219 (closed), GNOME Shell's window tracker was tweaked so that, with X11, these different applications are now correctly appearing as their own entries in GNOME Shell's application switcher. (In addition, their running state appears separately in the launcher).
However, we don't have a Wayland equivalent to this: if an application is sandboxed, get_app_for_window
skips any other checks and goes with the sandbox app ID.
You can compare these behaviours by running the following commands with the LibreOffice flatpak installed:
flatpak run --socket=x11 --nosocket=wayland org.libreoffice.LibreOffice --writer
You will see "LibreOffice Writer" in the application switcher.
flatpak run --socket=wayland --nosocket=x11 org.libreoffice.LibreOffice --writer
You will see "LibreOffice" in the application switcher.
How would you like it to work
The way GNOME Shell groups windows into applications - including windows belonging to sandboxed apps - should be the same using Wayland as it is using X11.
Relevant links, screenshots, screencasts etc.
I'm unfamiliar with what mechanisms we have with Wayland that are equivalent to WM_CLASS, but I suspect as a start it would make sense if GNOME Shell allows a sandboxed application to provide a GApplication ID as long as that ID is prefixed by its sandboxed app ID. This is equivalent to the prefix check in get_app_from_window_wmclass
…