Merge lp:~3v1n0/unity/quick-app-reopen-icon-fix into lp:unity
Status: | Merged | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Marco Trevisan (Treviño) | ||||||||||||||||
Approved revision: | no longer in the source branch. | ||||||||||||||||
Merged at revision: | 2358 | ||||||||||||||||
Proposed branch: | lp:~3v1n0/unity/quick-app-reopen-icon-fix | ||||||||||||||||
Merge into: | lp:unity | ||||||||||||||||
Diff against target: |
145 lines (+59/-4) 4 files modified
launcher/BamfLauncherIcon.cpp (+40/-2) launcher/BamfLauncherIcon.h (+2/-0) tests/autopilot/autopilot/tests/__init__.py (+3/-2) tests/autopilot/autopilot/tests/test_launcher.py (+14/-0) |
||||||||||||||||
To merge this branch: | bzr merge lp:~3v1n0/unity/quick-app-reopen-icon-fix | ||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Penhey (community) | Approve | ||
Thomi Richards (community) | Approve | ||
Review via email: mp+105873@code.launchpad.net |
Commit message
BamfLauncherIcon: add a timeout on application close before removing the icon
This makes the application to correctly hide when closed, but avoids
that the launcher icon is removed when an application is quickly opened/closed
Also we override the Remove() method to make sure that once it's called
we remove the "unity-seen" flag from the BamfApplication object.
So an application icon could be re-added in the period between the Remove()
call and the ~BamfLauncherIcon call (that could take some time).
Description of the change
If an application (i.e. GIMP, Hugin ...) quickly opens and closes a window so that the application is considered closed for few milliseconds, unity doesn't handle correctly the application re-open.
This is caused by the fact that when SimpleLauncherI
This makes the checks in LauncherController not to re-add an icon for the just re-opened application (as the "unity-seen" guard check fails).
So, to fix this I've overridden the Remove() method to force it to unset the "unity-seen" flag, and added a timeout before calling Remove() on application's close signal, so that if it's quickly re-opened the remove call is cancelled.
This won't cause any delay on actually hiding the icon from the launcher, since that is done when the application is not anymore on running state.
Added autopilot test to check this.
A crash can happen in libbamf with this fix, lp:~3v1n0/bamf/fix-window-removed-crash fixes it.
+1 from me. Probably needs someone to look at the C++ stuff as well.