Merge lp:~azzar1/unity/fix-925021 into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 2197
Proposed branch: lp:~azzar1/unity/fix-925021
Merge into: lp:unity
Prerequisite: lp:~3v1n0/unity/monitor-aware-launcher-icons
Diff against target: 52 lines (+6/-6)
3 files modified
plugins/unityshell/src/Launcher.cpp (+1/-1)
plugins/unityshell/src/SpacerLauncherIcon.cpp (+2/-2)
plugins/unityshell/src/SpacerLauncherIcon.h (+3/-3)
To merge this branch: bzr merge lp:~azzar1/unity/fix-925021
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+99382@code.launchpad.net

Commit message

Inserting items into launcher makes unnecessary animations on other monitors

Description of the change

== Problem ==
Inserting items into launcher makes unnecessary animations on other monitors

== Fix ==
Derive SpacerLauncherIcon from SingleMonitorLauncherIcon.

== Test ==
SingleMonitorLauncherIcon is already tested.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

This is fine and works, one thing that should improved is this case:
 1) Grab a launcher icon on monitor 1
 2) Drag it to the launcher on monitor 2

In that case, the SpacerLauncherIcon on monitor 1 should be removed, while a new one on monitor 2 should be added. Am I wrong?

Revision history for this message
Andrea Azzarone (azzar1) wrote :

Maybe you're right but you're talking about launcher icons and not dash icons. For launcher icons we don't add SpacerLauncherIcon :)

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

Yes, we add them. When reordering a launcher icon.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

We add space but we do it without using SpacerLauncherIcon.

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

Code is good, works well. +1

review: Approve

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-03-26 17:35:23 +0000
3+++ plugins/unityshell/src/Launcher.cpp 2012-03-26 17:35:23 +0000
4@@ -2841,7 +2841,7 @@
5 _drag_action = nux::DNDACTION_COPY;
6 if (!_dnd_hovered_icon && hovered_icon_is_appropriate)
7 {
8- _dnd_hovered_icon = new SpacerLauncherIcon();
9+ _dnd_hovered_icon = new SpacerLauncherIcon(monitor());
10 _dnd_hovered_icon->SetSortPriority(G_MAXINT);
11 _model->AddIcon(_dnd_hovered_icon);
12 _model->ReorderBefore(_dnd_hovered_icon, hovered_icon, true);
13
14=== modified file 'plugins/unityshell/src/SpacerLauncherIcon.cpp'
15--- plugins/unityshell/src/SpacerLauncherIcon.cpp 2012-03-14 06:24:18 +0000
16+++ plugins/unityshell/src/SpacerLauncherIcon.cpp 2012-03-26 17:35:23 +0000
17@@ -27,8 +27,8 @@
18 namespace launcher
19 {
20
21-SpacerLauncherIcon::SpacerLauncherIcon()
22- : SimpleLauncherIcon()
23+SpacerLauncherIcon::SpacerLauncherIcon(int monitor)
24+ : SingleMonitorLauncherIcon(monitor)
25 {
26 SetQuirk(QUIRK_VISIBLE, true);
27 SetQuirk(QUIRK_RUNNING, false);
28
29=== modified file 'plugins/unityshell/src/SpacerLauncherIcon.h'
30--- plugins/unityshell/src/SpacerLauncherIcon.h 2012-03-14 06:24:18 +0000
31+++ plugins/unityshell/src/SpacerLauncherIcon.h 2012-03-26 17:35:23 +0000
32@@ -20,17 +20,17 @@
33 #ifndef SPACERLAUNCHERICON_H
34 #define SPACERLAUNCHERICON_H
35
36-#include "SimpleLauncherIcon.h"
37+#include "SingleMonitorLauncherIcon.h"
38
39 namespace unity
40 {
41 namespace launcher
42 {
43
44-class SpacerLauncherIcon : public SimpleLauncherIcon
45+class SpacerLauncherIcon : public SingleMonitorLauncherIcon
46 {
47 public:
48- SpacerLauncherIcon();
49+ SpacerLauncherIcon(int monitor);
50
51 bool IsSpacer()
52 {