Merge lp://staging/~3v1n0/unity/create-local-desktop-file into lp://staging/unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Christopher Townsend
Approved revision: no longer in the source branch.
Merged at revision: 3458
Proposed branch: lp://staging/~3v1n0/unity/create-local-desktop-file
Merge into: lp://staging/unity
Diff against target: 602 lines (+195/-92)
11 files modified
launcher/ApplicationLauncherIcon.cpp (+36/-37)
launcher/LauncherDragWindow.cpp (+1/-1)
launcher/SoftwareCenterLauncherIcon.cpp (+0/-1)
tests/mock-application.h (+1/-0)
tests/test_application_launcher_icon.cpp (+118/-39)
tests/test_launcher.cpp (+4/-4)
tests/test_software_center_launcher_icon.cpp (+1/-1)
unity-shared/ApplicationManager.h (+2/-0)
unity-shared/BamfApplicationManager.cpp (+11/-0)
unity-shared/BamfApplicationManager.h (+2/-0)
unity-shared/StandaloneAppManager.cpp (+19/-9)
To merge this branch: bzr merge lp://staging/~3v1n0/unity/create-local-desktop-file
Reviewer Review Type Date Requested Status
Christopher Townsend (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+179016@code.staging.launchpad.net

Commit message

ApplicationLauncherIcon: Create a local desktop file when sticking an app that has not

Also make icon sticky only if both the icon itself and the inner app is sticky as well.

Description of the change

When we try to stick an application that has no desktop file (and no URI, in fact) we use bamf to generate the .desktop file. If/When this happens the application get notified with a desktop-file-updated signal that makes unity to update the icon and save it on favorites.

I sometime noticed that a "default icon" is shown instead of the real one, this seems mostly related to something else or a race... There's one line in bamf that can avoid this, but before reverting that I'd like to see if we can find a better solution.

As always, added and updated new unit tests

To post a comment you must log in.
Revision history for this message
Christopher Townsend (townsend) wrote :

I think this is almost working.

However, I ran into one problem where if I start a local app using ./name_of_exe, then the desktop file uses ./name_of_exe and when clicking the Launcher icon, it can't find ./name_of_exe. Is there any way to expand ./ to the full path?

Also, the .desktop file sticks around in .local/share/applications even after unpinning the icon from the Launcher. Is this intended behavior?

After I unpinned the icon, and then restarted the application using the full path, the already existing .desktop file did not get updated with the new full path. Not sure if the .desktop file is supposed to get updated or not.

Another behavior I noticed is that when I start the application using the Launcher icon (when the paths are correct), if I try quitting the application using Quit in the icon quicklist, the application won't quit.

review: Needs Information
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Christopher Townsend (townsend) wrote :

The last behavior I noted about quiting from the Quicklist seems to only happen the first time I start the app and then try quitting. If I kill the app via the terminal and then open it again via Launcher icon, then Quit works.

Revision history for this message
Christopher Townsend (townsend) wrote :

Well, my comments about the Quicklist Quit may be invalid because for some reason, the new bamfdaemon crashed due to a "BadWindow (invalid Window parameter)" X error. Not really sure what caused this, but after starting the new bamfdaemon again, Quit now works as expected.

The other comments still seem valid.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> However, I ran into one problem where if I start a local app using
> ./name_of_exe, then the desktop file uses ./name_of_exe and when clicking the
> Launcher icon, it can't find ./name_of_exe. Is there any way to expand ./ to
> the full path?

So, good catch! This lp:~3v1n0/bamf/working-dir-support bamf branch should fix this case by including the working directory path on generated .desktop file.

> Also, the .desktop file sticks around in .local/share/applications even after
> unpinning the icon from the Launcher. Is this intended behavior?

Yes, I thought about removing these .desktop files, but I also think that this is a also a nice way to create .desktop files for applications we only want to show in dash and that don't have a valid launcher (i.e. you stick it and then you unstick it).

> After I unpinned the icon, and then restarted the application using the full
> path, the already existing .desktop file did not get updated with the new full
> path. Not sure if the .desktop file is supposed to get updated or not.

Yeah, that's the wanted behaviour as the .desktop should be generated once and never touched anymore by unity.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Christopher Townsend (townsend) wrote :

For some reason, the TestLauncher.DragLauncherIconSavesIconOrderIfPositionHasNotChanged test is failing on armhf, which doesn't seem right...

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> For some reason, the
> TestLauncher.DragLauncherIconSavesIconOrderIfPositionHasNotChanged test is
> failing on armhf, which doesn't seem right...

Fixed it...

Revision history for this message
Christopher Townsend (townsend) wrote :

I still see the Quicklist Quit issue, but it's probably not related to this branch. I'll open a new bug about that.

This branch looks good, so +1!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.