Merge lp:~townsend/unity/fix-ql-tt-active-blur into lp:unity

Proposed by Christopher Townsend
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 3608
Proposed branch: lp:~townsend/unity/fix-ql-tt-active-blur
Merge into: lp:unity
Diff against target: 72 lines (+33/-0)
3 files modified
launcher/CairoBaseWindow.cpp (+6/-0)
launcher/CairoBaseWindow.h (+1/-0)
plugins/unityshell/src/unityshell.cpp (+26/-0)
To merge this branch: bzr merge lp:~townsend/unity/fix-ql-tt-active-blur
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+197527@code.launchpad.net

Commit message

Re-enable Quicklist and Tooltip active blurring since it was removed due to the performance merge.

Description of the change

= Issue =
Due to the performance improvement merge, Quicklist and Tooltips active blur was removed.

= Fix =
This re-enables active blurring in a manner similar to what was done before the aforementioned merge.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

44 + CompRegion region(geo.x, geo.y, geo.width, geo.height);

You can just use

if (damage.intersects(CompRectFromNuxGeo(geo))
...

Revision history for this message
Christopher Townsend (townsend) wrote :

Hey Marco,

Ah, yes, thanks for pointing that out. Branch is now updated.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/CairoBaseWindow.cpp'
2--- launcher/CairoBaseWindow.cpp 2013-10-29 22:39:42 +0000
3+++ launcher/CairoBaseWindow.cpp 2013-12-04 16:08:25 +0000
4@@ -69,6 +69,12 @@
5 animation::StartOrReverse(fade_animator_, animation::Direction::BACKWARD);
6 }
7
8+void CairoBaseWindow::RedrawBlur()
9+{
10+ compute_blur_bkg_ = true;
11+ QueueDraw();
12+}
13+
14 bool CairoBaseWindow::HasBlurredBackground() const
15 {
16 return use_blurred_background_;
17
18=== modified file 'launcher/CairoBaseWindow.h'
19--- launcher/CairoBaseWindow.h 2013-10-29 22:39:42 +0000
20+++ launcher/CairoBaseWindow.h 2013-12-04 16:08:25 +0000
21@@ -36,6 +36,7 @@
22 virtual void Show();
23 virtual void Hide();
24
25+ void RedrawBlur();
26 bool HasBlurredBackground() const;
27
28 protected:
29
30=== modified file 'plugins/unityshell/src/unityshell.cpp'
31--- plugins/unityshell/src/unityshell.cpp 2013-11-20 21:39:40 +0000
32+++ plugins/unityshell/src/unityshell.cpp 2013-12-04 16:08:25 +0000
33@@ -1557,6 +1557,17 @@
34 cScreen->donePaint();
35 }
36
37+void redraw_view_if_damaged(nux::ObjectPtr<CairoBaseWindow> const& view, CompRegion const& damage)
38+{
39+ if (!view || view->IsRedrawNeeded())
40+ return;
41+
42+ auto const& geo = view->GetAbsoluteGeometry();
43+
44+ if (damage.intersects(CompRectFromNuxGeo(geo)))
45+ view->RedrawBlur();
46+}
47+
48 void UnityScreen::compizDamageNux(CompRegion const& damage)
49 {
50 /* Ask nux to present anything in our damage region
51@@ -1576,6 +1587,21 @@
52 auto const& geo = NuxGeometryFromCompRect(r);
53 wt->PresentWindowsIntersectingGeometryOnThisFrame(geo);
54 }
55+
56+ auto const& launchers = launcher_controller_->launchers();
57+
58+ for (auto const& launcher : launchers)
59+ {
60+ if (!launcher->Hidden())
61+ {
62+ redraw_view_if_damaged(launcher->GetActiveTooltip(), damage);
63+ }
64+ }
65+
66+ if (QuicklistManager* qm = QuicklistManager::Default())
67+ {
68+ redraw_view_if_damaged(qm->Current(), damage);
69+ }
70 }
71
72 /* Grab changed nux regions and add damage rects for them */