Merge lp:~3v1n0/unity/launcher-dnd-icon-damage-fix-5.0 into lp:unity/5.0

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 2397
Proposed branch: lp:~3v1n0/unity/launcher-dnd-icon-damage-fix-5.0
Merge into: lp:unity/5.0
Diff against target: 182 lines (+66/-16)
4 files modified
manual-tests/Launcher.txt (+17/-1)
plugins/unityshell/src/Launcher.cpp (+6/-1)
plugins/unityshell/src/Launcher.h (+2/-1)
plugins/unityshell/src/unityshell.cpp (+41/-13)
To merge this branch: bzr merge lp:~3v1n0/unity/launcher-dnd-icon-damage-fix-5.0
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve
Andrea Azzarone (community) Approve
Review via email: mp+118146@code.launchpad.net

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

Commit message

unityshell: correctly damage the LauncherDragWindow region

Description of the change

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) :
review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity/1005/console reported an error when processing this lp:~3v1n0/unity/launcher-dnd-icon-damage-fix-5.0 branch.
Not merging it.

Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity/1006/console reported an error when processing this lp:~3v1n0/unity/launcher-dnd-icon-damage-fix-5.0 branch.
Not merging it.

Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity/1008/console reported an error when processing this lp:~3v1n0/unity/launcher-dnd-icon-damage-fix-5.0 branch.
Not merging it.

Revision history for this message
Unity Merger (unity-merger) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Fixed problem, and looks good! +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'manual-tests/Launcher.txt'
2--- manual-tests/Launcher.txt 2012-08-03 17:02:48 +0000
3+++ manual-tests/Launcher.txt 2012-08-03 19:05:23 +0000
4@@ -151,7 +151,7 @@
5
6
7 Dragging icons to reorder - away from launcher
8------------------------------------------
9+----------------------------------------------
10 This test is about reordering the icons without the animation showing.
11
12 #. Move the mouse so it is over a launcher icon for an application
13@@ -169,6 +169,22 @@
14 it, and the any pips for running apps show again.
15
16
17+Dragged launcher icons out of the launcher are properly drawn
18+-------------------------------------------------------------
19+This test ensures that the launcher icons out of the launcher are properly drawn
20+
21+Setup:
22+
23+Actions:
24+#. Move the mouse so it is over a launcher icon for an application
25+#. Press and hold the mouse button
26+#. Drag the icon away from the launcher, in the middle of the display
27+#. Don't move the mouse pointer for some (4-5) seconds, keeping the button pressed
28+
29+Expected Result:
30+ * The icon is always drawn, even when the mouse pointer does not move.
31+
32+
33 Dragging icon while program is starting
34 ---------------------------------------
35 This test that when a program is executed from the launcher and the icon is
36
37=== modified file 'plugins/unityshell/src/Launcher.cpp'
38--- plugins/unityshell/src/Launcher.cpp 2012-08-03 17:02:48 +0000
39+++ plugins/unityshell/src/Launcher.cpp 2012-08-03 19:05:23 +0000
40@@ -1652,11 +1652,16 @@
41 }
42 }
43
44-nux::ObjectPtr<nux::View> Launcher::GetActiveTooltip() const
45+nux::ObjectPtr<nux::View> const& Launcher::GetActiveTooltip() const
46 {
47 return _active_tooltip;
48 }
49
50+nux::ObjectPtr<LauncherDragWindow> Launcher::GetDraggedIcon() const
51+{
52+ return nux::ObjectPtr<LauncherDragWindow>(_drag_window);
53+}
54+
55 void
56 Launcher::SetActionState(LauncherActionState actionstate)
57 {
58
59=== modified file 'plugins/unityshell/src/Launcher.h'
60--- plugins/unityshell/src/Launcher.h 2012-08-03 17:02:48 +0000
61+++ plugins/unityshell/src/Launcher.h 2012-08-03 19:05:23 +0000
62@@ -99,7 +99,8 @@
63 return _parent;
64 };
65
66- nux::ObjectPtr<nux::View> GetActiveTooltip() const; // nullptr = no tooltip
67+ nux::ObjectPtr<nux::View> const& GetActiveTooltip() const;
68+ nux::ObjectPtr<LauncherDragWindow> GetDraggedIcon() const;
69
70 virtual void RecvMouseUp(int x, int y, unsigned long button_flags, unsigned long key_flags);
71 virtual void RecvMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags);
72
73=== modified file 'plugins/unityshell/src/unityshell.cpp'
74--- plugins/unityshell/src/unityshell.cpp 2012-08-01 00:53:24 +0000
75+++ plugins/unityshell/src/unityshell.cpp 2012-08-03 19:05:23 +0000
76@@ -1429,31 +1429,48 @@
77 }
78 }
79
80- auto launchers = launcher_controller_->launchers();
81- for (auto launcher : launchers)
82+ auto const& launchers = launcher_controller_->launchers();
83+ for (auto const& launcher : launchers)
84 {
85 if (!launcher->Hidden())
86 {
87- nux::Geometry geo = launcher->GetAbsoluteGeometry();
88+ nux::Geometry const& geo = launcher->GetAbsoluteGeometry();
89 CompRegion launcher_region(geo.x, geo.y, geo.width, geo.height);
90+
91 if (damage.intersects(launcher_region))
92 launcher->QueueDraw();
93- nux::ObjectPtr<nux::View> tooltip = launcher->GetActiveTooltip();
94- if (!tooltip.IsNull())
95+
96+ nux::ObjectPtr<nux::View> const& tooltip = launcher->GetActiveTooltip();
97+
98+ if (tooltip)
99 {
100- nux::Geometry tip = tooltip->GetAbsoluteGeometry();
101- CompRegion tip_region(tip.x, tip.y, tip.width, tip.height);
102+ nux::Geometry const& g = tooltip->GetAbsoluteGeometry();
103+ CompRegion tip_region(g.x, g.y, g.width, g.height);
104+
105 if (damage.intersects(tip_region))
106 tooltip->QueueDraw();
107 }
108+
109+ nux::ObjectPtr<LauncherDragWindow> const& dragged_icon = launcher->GetDraggedIcon();
110+
111+ if (dragged_icon)
112+ {
113+ nux::Geometry const& g = dragged_icon->GetAbsoluteGeometry();
114+ CompRegion icon_region(g.x, g.y, g.width, g.height);
115+
116+ if (damage.intersects(icon_region))
117+ dragged_icon->QueueDraw();
118+ }
119 }
120 }
121
122 std::vector<nux::View*> const& panels(panel_controller_->GetPanelViews());
123 for (nux::View* view : panels)
124 {
125- nux::Geometry geo = view->GetAbsoluteGeometry();
126+ nux::Geometry const& geo = view->GetAbsoluteGeometry();
127+
128 CompRegion panel_region(geo.x, geo.y, geo.width, geo.height);
129+
130 if (damage.intersects(panel_region))
131 view->QueueDraw();
132 }
133@@ -1464,8 +1481,9 @@
134 QuicklistView* view = qm->Current();
135 if (view)
136 {
137- nux::Geometry geo = view->GetAbsoluteGeometry();
138+ nux::Geometry const& geo = view->GetAbsoluteGeometry();
139 CompRegion quicklist_region(geo.x, geo.y, geo.width, geo.height);
140+
141 if (damage.intersects(quicklist_region))
142 view->QueueDraw();
143 }
144@@ -1488,7 +1506,8 @@
145 CompRegion nux_damage;
146
147 std::vector<nux::Geometry> const& dirty = wt->GetDrawList();
148- for (auto geo : dirty)
149+
150+ for (auto const& geo : dirty)
151 nux_damage += CompRegion(geo.x, geo.y, geo.width, geo.height);
152
153 if (launcher_controller_->IsOverlayOpen())
154@@ -1498,17 +1517,26 @@
155 nux_damage += CompRegion(geo.x, geo.y, geo.width, geo.height);
156 }
157
158- auto launchers = launcher_controller_->launchers();
159- for (auto launcher : launchers)
160+ auto const& launchers = launcher_controller_->launchers();
161+ for (auto const& launcher : launchers)
162 {
163 if (!launcher->Hidden())
164 {
165 nux::ObjectPtr<nux::View> tooltip = launcher->GetActiveTooltip();
166- if (!tooltip.IsNull())
167+
168+ if (tooltip)
169 {
170 nux::Geometry const& g = tooltip->GetAbsoluteGeometry();
171 nux_damage += CompRegion(g.x, g.y, g.width, g.height);
172 }
173+
174+ nux::ObjectPtr<LauncherDragWindow> const& dragged_icon = launcher->GetDraggedIcon();
175+
176+ if (dragged_icon)
177+ {
178+ nux::Geometry const& g = dragged_icon->GetAbsoluteGeometry();
179+ nux_damage += CompRegion(g.x, g.y, g.width, g.height);
180+ }
181 }
182 }
183

Subscribers

People subscribed via source and target branches