Merge lp:~sil2100/unity/launcher_dnd_flicker_5.0 into lp:unity/5.0

Proposed by Łukasz Zemczak on 2012-06-06
Status: Merged
Approved by: Didier Roche on 2012-06-06
Approved revision: 2360
Merged at revision: 2361
Proposed branch: lp:~sil2100/unity/launcher_dnd_flicker_5.0
Merge into: lp:unity/5.0
Diff against target: 35 lines (+10/-3)
1 file modified
plugins/unityshell/src/Launcher.cpp (+10/-3)
To merge this branch: bzr merge lp:~sil2100/unity/launcher_dnd_flicker_5.0
Reviewer Review Type Date Requested Status
Unity Team 2012-06-06 Pending
Review via email: mp+108903@code.launchpad.net

Commit message

Back-porting fix from unity trunk.
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

Copy-pasted description from the original, 6.0 MRQ.

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.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/unityshell/src/Launcher.cpp'
--- plugins/unityshell/src/Launcher.cpp 2012-05-24 11:33:05 +0000
+++ plugins/unityshell/src/Launcher.cpp 2012-06-06 09:30:27 +0000
@@ -2696,9 +2696,6 @@
26962696
2697 _hide_machine->SetQuirk(LauncherHideMachine::EXTERNAL_DND_ACTIVE, true);2697 _hide_machine->SetQuirk(LauncherHideMachine::EXTERNAL_DND_ACTIVE, true);
26982698
2699 if (IsOverlayOpen())
2700 SaturateIcons();
2701
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 }
2721}2728}
27222729
2723void2730void

Subscribers

People subscribed via source and target branches

to all changes: