After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 778985 - shell: Use a different application-id for web apps
shell: Use a different application-id for web apps
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
: 779022 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-02-20 21:41 UTC by Florian Müllner
Modified: 2017-03-05 17:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
shell: Use a different application-id for web apps (1.78 KB, patch)
2017-02-20 21:41 UTC, Florian Müllner
none Details | Review
shell: Use a different application-id for web apps (1.78 KB, patch)
2017-03-05 03:36 UTC, Michael Catanzaro
none Details | Review
shell: Use a different application-id for web apps (1.81 KB, patch)
2017-03-05 03:43 UTC, Michael Catanzaro
committed Details | Review

Description Florian Müllner 2017-02-20 21:41:33 UTC
See patch.
Comment 1 Florian Müllner 2017-02-20 21:41:38 UTC
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.
Comment 2 Florian Müllner 2017-02-21 13:51:09 UTC
*** Bug 779022 has been marked as a duplicate of this bug. ***
Comment 3 Michael Catanzaro 2017-02-21 20:50:44 UTC
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.
Comment 4 Florian Müllner 2017-02-21 20:59:44 UTC
(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 :-)
Comment 5 Michael Catanzaro 2017-02-21 21:36:13 UTC
(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.
Comment 6 Michael Catanzaro 2017-03-04 21:25:55 UTC
(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.
Comment 7 Florian Müllner 2017-03-04 21:45:15 UTC
(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)
Comment 8 Michael Catanzaro 2017-03-05 03:33:37 UTC
(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.
Comment 9 Michael Catanzaro 2017-03-05 03:36:33 UTC
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.
Comment 10 Michael Catanzaro 2017-03-05 03:43:46 UTC
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.
Comment 11 Florian Müllner 2017-03-05 10:08:15 UTC
Review of attachment 347251 [details] [review]:

LGTM
Comment 12 Michael Catanzaro 2017-03-05 17:29:07 UTC
Attachment 347251 [details] pushed as 2ddf52d - shell: Use a different application-id for web apps