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
1=== modified file 'plugins/unityshell/src/Launcher.cpp'
2--- plugins/unityshell/src/Launcher.cpp 2012-05-24 11:33:05 +0000
3+++ plugins/unityshell/src/Launcher.cpp 2012-06-06 09:30:27 +0000
4@@ -2696,9 +2696,6 @@
5
6 _hide_machine->SetQuirk(LauncherHideMachine::EXTERNAL_DND_ACTIVE, true);
7
8- if (IsOverlayOpen())
9- SaturateIcons();
10-
11 for (auto it : _dnd_data.Uris())
12 {
13 if (g_str_has_suffix(it.c_str(), ".desktop"))
14@@ -2713,11 +2710,21 @@
15 for (auto it : *_model)
16 {
17 if (it->ShouldHighlightOnDrag(_dnd_data))
18+ {
19+ it->SetQuirk(AbstractLauncherIcon::QUIRK_DESAT, false);
20 it->SetQuirk(AbstractLauncherIcon::QUIRK_DROP_PRELIGHT, true);
21+ }
22 else
23+ {
24 it->SetQuirk(AbstractLauncherIcon::QUIRK_DROP_DIM, true);
25+ }
26 }
27 }
28+ else
29+ {
30+ if (IsOverlayOpen())
31+ SaturateIcons();
32+ }
33 }
34
35 void

Subscribers

People subscribed via source and target branches

to all changes: