The way we're currently doing it is by setting the environment from the
desktop file, and that works OK for things launched from that desktop
file (right?).

So if when running a snap we find that env key not set, I think we need
to set BAMF_DESKTOP_FILE_HINT to *something*. Otherwise things (bamf in
this instance, but I'm sure other desktops do something similar) can and
will pick up the unwrapped binary, in cases where the app is actually a
wrapper shell script.

So, I think what we do today in snappy is OK, in that we copy the snap-
provided desktop files over, but it's not enough: we need to be a bit
smarter, and ensure that every app that requests unity7 (and x11,
methinks) has a desktop file, either generating it ourselves or denying
the interface when missing, and we need to set that env key to point to
something ourselves if it isn't set already.

If a snap provides multiple desktop files per app, and the env key isn't
provided, I think just matching the shortest exec line would work. If
the app needs more control they can provide multiple apps that map to
the same binary.

If an app is launched that requests one of these interfaces and we can't
match it with a desktop file, we should bail. This'll cover corner cases
related to weird upgrade paths, amongst other things.

To recap, I think:

* `snap install` and friends should start creating desktop files when needed 
and missing (iow, if snap run won't be able to find it)
* `snap run` figures out if the thing should have BAMF_DESKTOP_FILE_HINT, find 
the right desktop file, and set it to that; bailing if missing (if there's a 
way to know we were launched not-from-command-line, pop up a dialog?)
* `snap-confine` should bail if an interface that we know needs this doesn't 
have it

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1643910

Title:
  BAMF_DESKTOP_FILE_HINT not set in correct place for unity7

To manage notifications about this bug go to:
https://bugs.launchpad.net/snappy/+bug/1643910/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to