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
=== modified file 'plugins/unityshell/src/Launcher.cpp'
--- plugins/unityshell/src/Launcher.cpp 2012-03-26 17:35:23 +0000
+++ plugins/unityshell/src/Launcher.cpp 2012-03-26 17:35:23 +0000
@@ -2841,7 +2841,7 @@
2841 _drag_action = nux::DNDACTION_COPY;2841 _drag_action = nux::DNDACTION_COPY;
2842 if (!_dnd_hovered_icon && hovered_icon_is_appropriate)2842 if (!_dnd_hovered_icon && hovered_icon_is_appropriate)
2843 {2843 {
2844 _dnd_hovered_icon = new SpacerLauncherIcon();2844 _dnd_hovered_icon = new SpacerLauncherIcon(monitor());
2845 _dnd_hovered_icon->SetSortPriority(G_MAXINT);2845 _dnd_hovered_icon->SetSortPriority(G_MAXINT);
2846 _model->AddIcon(_dnd_hovered_icon);2846 _model->AddIcon(_dnd_hovered_icon);
2847 _model->ReorderBefore(_dnd_hovered_icon, hovered_icon, true);2847 _model->ReorderBefore(_dnd_hovered_icon, hovered_icon, true);
28482848
=== modified file 'plugins/unityshell/src/SpacerLauncherIcon.cpp'
--- plugins/unityshell/src/SpacerLauncherIcon.cpp 2012-03-14 06:24:18 +0000
+++ plugins/unityshell/src/SpacerLauncherIcon.cpp 2012-03-26 17:35:23 +0000
@@ -27,8 +27,8 @@
27namespace launcher27namespace launcher
28{28{
2929
30SpacerLauncherIcon::SpacerLauncherIcon()30SpacerLauncherIcon::SpacerLauncherIcon(int monitor)
31 : SimpleLauncherIcon()31 : SingleMonitorLauncherIcon(monitor)
32{32{
33 SetQuirk(QUIRK_VISIBLE, true);33 SetQuirk(QUIRK_VISIBLE, true);
34 SetQuirk(QUIRK_RUNNING, false);34 SetQuirk(QUIRK_RUNNING, false);
3535
=== modified file 'plugins/unityshell/src/SpacerLauncherIcon.h'
--- plugins/unityshell/src/SpacerLauncherIcon.h 2012-03-14 06:24:18 +0000
+++ plugins/unityshell/src/SpacerLauncherIcon.h 2012-03-26 17:35:23 +0000
@@ -20,17 +20,17 @@
20#ifndef SPACERLAUNCHERICON_H20#ifndef SPACERLAUNCHERICON_H
21#define SPACERLAUNCHERICON_H21#define SPACERLAUNCHERICON_H
2222
23#include "SimpleLauncherIcon.h"23#include "SingleMonitorLauncherIcon.h"
2424
25namespace unity25namespace unity
26{26{
27namespace launcher27namespace launcher
28{28{
2929
30class SpacerLauncherIcon : public SimpleLauncherIcon30class SpacerLauncherIcon : public SingleMonitorLauncherIcon
31{31{
32public:32public:
33 SpacerLauncherIcon();33 SpacerLauncherIcon(int monitor);
3434
35 bool IsSpacer()35 bool IsSpacer()
36 {36 {