Merge lp:~sil2100/unity/launcher_dnd_flicker_new into lp:unity

Proposed by Łukasz Zemczak on 2012-05-08
Status: Merged
Approved by: Didier Roche on 2012-06-05
Approved revision: 2355
Merged at revision: 2389
Proposed branch: lp:~sil2100/unity/launcher_dnd_flicker_new
Merge into: lp:unity
Diff against target: 35 lines (+10/-3)
1 file modified
launcher/Launcher.cpp (+10/-3)
To merge this branch: bzr merge lp:~sil2100/unity/launcher_dnd_flicker_new
Reviewer Review Type Date Requested Status
Jason Smith (community) 2012-06-01 Approve on 2012-06-05
Sam Spilsbury (community) Approve on 2012-06-01
Alex Launi quality 2012-05-08 Pending
Review via email:

This proposal supersedes a proposal from 2012-04-08.

Commit message

When dragging a non-application, do not saturate all icons automatically, but only those that are needed.

Eliminates flickering before 'prelighting' the Launcher icons that can handle the current drag-and-drop (LP #863230).

Description of the change

Problem description:

When drag-and-dropping from the Dash to the Launcher a non-application icon (for instance, a PNG file), the Launcher 'flickers' a bit. This flickering means that the Launcher icons get desaturated for a moment and then loose saturation again (as originally intended), tinted (LP #863230 and more specifically - LP #971086).

The fix:

During drag and drop, instead of saturating all icons automatically when overlay is present, we only do this when we know that we're not dragging a non-application. Otherwise, only saturate the icons that we will actually 'prelight' (i.e. indicate that can handle the given file). This way, there is no flickering and all icons visualize correctly, as intended. There are no longer any tinting problems as well (as noted by JohnLea).

Test coverage:

The following fix can be tested by manual testing of the specified bugs (LP #863230, LP #971086). Problem no longer occurs.

To post a comment you must log in.
Alex Launi (alexlauni) wrote : Posted in a previous version of this proposal

Please add tests to the suite in manual-tests/

review: Needs Fixing (quality)
Łukasz Zemczak (sil2100) wrote : Posted in a previous version of this proposal

There already seems to be a manual-test that theoretically tests the given behavior:
manual-tests/Dash.txt -> "Launcher drop target saturation test" (from the "Drag and drop tests" section).

Should I modify it more to add details regarding this bug? But it seems rather sufficient.

Alex Launi (alexlauni) wrote : Posted in a previous version of this proposal

Good catch! Thanks. Yeah the current test is sufficient.

review: Approve (quality)
Unity Merger (unity-merger) wrote : Posted in a previous version of this proposal

Attempt to merge into lp:unity failed due to conflicts:

text conflict in plugins/unityshell/src/Launcher.cpp

Łukasz Zemczak (sil2100) wrote :

I resubmitted the merge with a new branch, based on the latest lp:unity on trunk (after the restructuring). Hope I didn't miss anything.

Łukasz Zemczak (sil2100) wrote :

Merged in updated trunk.

Sam Spilsbury (smspillaz) wrote :

I'm happy with the code, although a flag that we need to get LauncherHideMachine under some sort of test because there's lots of state information there which can be easily clobbered by the sounds of things.

review: Approve
Jason Smith (jassmith) wrote :

looks wholly sane, +1

review: Approve
Unity Merger (unity-merger) wrote :

No commit message specified.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'launcher/Launcher.cpp'
--- launcher/Launcher.cpp 2012-05-24 11:04:32 +0000
+++ launcher/Launcher.cpp 2012-05-31 11:06:28 +0000
@@ -2696,9 +2696,6 @@
2697 _hide_machine->SetQuirk(LauncherHideMachine::EXTERNAL_DND_ACTIVE, true);2697 _hide_machine->SetQuirk(LauncherHideMachine::EXTERNAL_DND_ACTIVE, true);
2699 if (IsOverlayOpen())
2700 SaturateIcons();
2702 for (auto it : _dnd_data.Uris())2699 for (auto it : _dnd_data.Uris())
2703 {2700 {
2704 if (g_str_has_suffix(it.c_str(), ".desktop"))2701 if (g_str_has_suffix(it.c_str(), ".desktop"))
@@ -2713,11 +2710,21 @@
2713 for (auto it : *_model)2710 for (auto it : *_model)
2714 {2711 {
2715 if (it->ShouldHighlightOnDrag(_dnd_data))2712 if (it->ShouldHighlightOnDrag(_dnd_data))
2713 {
2714 it->SetQuirk(AbstractLauncherIcon::QUIRK_DESAT, false);
2716 it->SetQuirk(AbstractLauncherIcon::QUIRK_DROP_PRELIGHT, true);2715 it->SetQuirk(AbstractLauncherIcon::QUIRK_DROP_PRELIGHT, true);
2716 }
2717 else2717 else
2718 {
2718 it->SetQuirk(AbstractLauncherIcon::QUIRK_DROP_DIM, true);2719 it->SetQuirk(AbstractLauncherIcon::QUIRK_DROP_DIM, true);
2720 }
2719 }2721 }
2720 }2722 }
2723 else
2724 {
2725 if (IsOverlayOpen())
2726 SaturateIcons();
2727 }