GNOME Bugzilla – Bug 778985
shell: Use a different application-id for web apps
Last modified: 2017-03-05 17:29:16 UTC
See patch.
Created attachment 346288 [details] [review] shell: Use a different application-id for web apps Since epiphany renamed its .desktop file, web apps no longer appear as separate applications in GNOME, but are all grouped under the regular epiphany application. This happens because the GApplication ID is among the properties gnome-shell uses to match a .desktop file to a window, and as that match now succeeds, the WM_CLASS that points to the correct .desktop file is not used at all. It may be nice to make web apps' .desktop files use reverse notation as well in the future and use a matching GApplication ID, but for now just using an ID that cannot be resolved to a .desktop file is enough to make gnome-shell fall back to matching on the WM_CLASS again.
*** Bug 779022 has been marked as a duplicate of this bug. ***
It looks fine, but I'm going to try to implement your recommendation since some of this logic needs to change for bug #773716 anyway.
(In reply to Michael Catanzaro from comment #3) > It looks fine On second thought, I think "org.gnome.Epiphany.WebApp" would be more flatpak-friendly (though I have no idea how well web apps currently work under flatpak). > I'm going to try to implement your recommendation since > some of this logic needs to change for bug #773716 anyway. Heh, even better :-)
(In reply to Florian Müllner from comment #4) > (In reply to Michael Catanzaro from comment #3) > > It looks fine > > On second thought, I think "org.gnome.Epiphany.WebApp" would be more > flatpak-friendly (though I have no idea how well web apps currently work > under flatpak). Hm... I don't either... I think web apps cannot possibly work under Flatpak unless we have a way to dynamically choose files to export to the host, or to export and entire directory. Otherwise how could the host ever see desktop files created by Epiphany? Anyway, the official Flatpak build of Epiphany is 3.22.0, which is not secure and should not be used, so clearly nobody is doing even basic security support for the GNOME Flatpaks. And I'm told it has problems displaying YouTube. So the Flatpak has bigger problems before we begin to think about web apps under Flatpak. We should probably not go ahead and implement something now that's going to be problematic for Flatpak, but web apps already need to know their desktop file in order to get the title, otherwise they'll just crash. And if it has the desktop file, it can set the GtkApplication ID, so I don't see any disadvantage to your proposal.
(In reply to Florian Müllner from comment #4) > (In reply to Michael Catanzaro from comment #3) > > It looks fine > > On second thought, I think "org.gnome.Epiphany.WebApp" would be more > flatpak-friendly (though I have no idea how well web apps currently work > under flatpak). Well then different web apps will be considered the same web app, right? Let's use a unique ID for each web app.
(In reply to Michael Catanzaro from comment #6) > (In reply to Florian Müllner from comment #4) > > On second thought, I think "org.gnome.Epiphany.WebApp" would be more > > flatpak-friendly > > Well then different web apps will be considered the same web app, right? Only if you add an org.gnome.Epiphany.WebApp.desktop file. As mentioned in the commit, if there is no match, then gnome-shell will eventually use the WM_CLASS to find the correct .desktop file for each web app. (That said, making a heuristic with a higher priority fail on purpose to force a fallback to something considered less reliable *is* fishy. Unique IDs that match the correct .desktop files are definitely nicer)
(In reply to Michael Catanzaro from comment #6) > Well then different web apps will be considered the same web app, right? > Let's use a unique ID for each web app. The migration is a bit complicated. Let's go with your patch for now. I'm just going to adjust the code style a bit.
Created attachment 347250 [details] [review] shell: Use a different application-id for web apps Florian, please approve it since I used your name and commit message.
Created attachment 347251 [details] [review] shell: Use a different application-id for web apps Since epiphany renamed its .desktop file, web apps no longer appear as separate applications in GNOME, but are all grouped under the regular epiphany application. This happens because the GApplication ID is among the properties gnome-shell uses to match a .desktop file to a window, and as that match now succeeds, the WM_CLASS that points to the correct .desktop file is not used at all. It may be nice to make web apps' .desktop files use reverse notation as well in the future and use a matching GApplication ID, but for now just using an ID that cannot be resolved to a .desktop file is enough to make gnome-shell fall back to matching on the WM_CLASS again.
Review of attachment 347251 [details] [review]: LGTM
Attachment 347251 [details] pushed as 2ddf52d - shell: Use a different application-id for web apps