Merge lp:~thumper/unity/regional-damage-sru into lp:unity/5.0
- regional-damage-sru
- Merge into 5.0
Status: | Merged |
---|---|
Approved by: | Łukasz Zemczak |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2394 |
Proposed branch: | lp:~thumper/unity/regional-damage-sru |
Merge into: | lp:unity/5.0 |
Diff against target: |
784 lines (+353/-117) 12 files modified
manual-tests/Dash.txt (+15/-0) manual-tests/Launcher.txt (+15/-0) manual-tests/Panel.txt (+17/-0) manual-tests/WindowManagement.txt (+20/-0) plugins/unityshell/src/AbstractLauncherIcon.h (+1/-0) plugins/unityshell/src/Launcher.cpp (+11/-0) plugins/unityshell/src/Launcher.h (+4/-0) plugins/unityshell/src/LauncherIcon.cpp (+3/-0) plugins/unityshell/src/PanelController.cpp (+15/-0) plugins/unityshell/src/PanelController.h (+1/-0) plugins/unityshell/src/unityshell.cpp (+239/-110) plugins/unityshell/src/unityshell.h (+12/-7) |
To merge this branch: | bzr merge lp:~thumper/unity/regional-damage-sru |
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Łukasz Zemczak | Approve | ||
Marco Trevisan (Treviño) | Approve | ||
Daniel van Vugt | Approve | ||
Review via email: mp+116796@code.launchpad.net |
Commit message
Backport the fixes for regional damage, and the regressions that were introduced by it.
Fixes lots of bugs.
Description of the change
This branch backports the fixes for regional damage, and the regression that were introduced by it.
Fixes lots of bugs.
Daniel van Vugt (vanvugt) wrote : | # |
Daniel van Vugt (vanvugt) wrote : | # |
Looks OK but keeps crashing when I run it on nvidia-295.49. The crash does not happen with lp:unity/5.0 !?
(gdb) bt
#0 0x00007fb402b65e1e in ?? () from /usr/lib/
#1 0x00007fb402c09da1 in ?? () from /usr/lib/
#2 0x00007fb402e0ada1 in ?? () from /usr/lib/
#3 0x00007fb402e081f3 in ?? () from /usr/lib/
#4 0x00007fb3ff4df22a in nux::GraphicsEn
from /usr/lib/
#5 0x00007fb3ff4c98e9 in nux::GraphicsEn
from /usr/lib/
#6 0x00007fb3ff822891 in nux::WindowComp
#7 0x00007fb3ff825990 in nux::WindowComp
from /usr/lib/
#8 0x00007fb3ff825cca in nux::WindowComp
#9 0x00007fb3ff82ccb1 in nux::WindowThre
#10 0x00007fb4003e8cc4 in unity::
Daniel van Vugt (vanvugt) wrote : | # |
And yes I did try compiling the latest lp:nux/2.0 as well. But when I use it, I get NO readable stacktrace of the crash.
Daniel van Vugt (vanvugt) wrote : | # |
Uninstalled nvidia-295.49 and tested with nouveau. Now it works well.
Can anyone else confirm the nvidia crash?
Daniel van Vugt (vanvugt) wrote : | # |
Verified; works on intel too. Why is only nvidia broken?!
Brenton Hall (brent-hall-27) wrote : | # |
Compiled it. Running fine on ATI, using the open drivers.
Brenton Hall (brent-hall-27) wrote : | # |
Been through the new manual tests for this branch. They all passed for ATI.
Daniel van Vugt (vanvugt) wrote : | # |
Tested Unit 6.0 and Nux 3.0 again. They now crash in the same way on nvidia. So it's nothing to do with this branch.
I also upgraded nvidia 295.40 to 295.49 but no difference (other than the stack traces are now completely unreadable).
I suspect the nvidia problem could be related to bug 982485 or bug 980298. When run under valgrind, I get a rubbish stack, but it happens immediately after bug 988880, which might be relevant.
Anyway, this branch seems good but I can't test it on nvidia-
Daniel van Vugt (vanvugt) wrote : | # |
Actually, bug 982626 seems to describe the exact crash I'm getting now. Let's make that a separate discussion to this.
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
I can confirm the crash on a Nvidia GeForce GT 650M, the first time I launched this unity branch it worked and it also seemed to fix the bug #915265, however it hanged and after reloading compiz (one or two times), I can't run it anymore.
Gdb complains issues related to the nvidia bloab, so... It's not helpful at all.
The same happens with trunk with this change enabled.
Łukasz Zemczak (sil2100) wrote : | # |
I would probably like to have this fixed before releasing this as an SRU. I know we have the same bug in trunk and quantal, but Precise is a LTS, so we probably shouldn't release anything that has any known ill side-effects. So fixing bug #982626 becomes rather a priority here.
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
FYI this is the stacktrace of the crash that I'm getting http://
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
A weird thing about this crash is that if I replace an unity sesssion, from unity it will always crash.
If I replace it after a tty switch, then there's no crash...
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Using a bad workaround like this, seems to bypass the crash... http://
Checking something better.
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Ok, thanks to the Sam's tip, I got the proper fix for the crash that was affecting the nvidia cards (using the nvidia driver).
I've made a branch that fixes this, and that uses this one as prerequisite: lp:~3v1n0/unity/fix-nvidia-glDrawArrays-crash-5.0/+merge/117553
So, at this point I can approve this branch too.
Łukasz Zemczak (sil2100) wrote : | # |
Since I already tested the branch, along with Alan and the Nice guys, I think it's safe to apply as the nvidia bug is getting handled as well.
Unity Merger (unity-merger) wrote : | # |
No commit message specified.
Preview Diff
1 | === modified file 'manual-tests/Dash.txt' | |||
2 | --- manual-tests/Dash.txt 2012-06-21 16:10:54 +0000 | |||
3 | +++ manual-tests/Dash.txt 2012-07-26 05:12:23 +0000 | |||
4 | @@ -203,6 +203,21 @@ | |||
5 | 203 | Outcome: | 203 | Outcome: |
6 | 204 | The Dash should close and the music file should open up in Firefox. | 204 | The Dash should close and the music file should open up in Firefox. |
7 | 205 | 205 | ||
8 | 206 | |||
9 | 207 | DnD stacking | ||
10 | 208 | ------------ | ||
11 | 209 | |||
12 | 210 | Setup: | ||
13 | 211 | #. Open the Dash (Super). | ||
14 | 212 | |||
15 | 213 | Action: | ||
16 | 214 | #. Drag any icon from the dash and wave it over the dash and launcher area. | ||
17 | 215 | |||
18 | 216 | Outcome: | ||
19 | 217 | The icon being dragged is drawn on top of the dash and launcher. Never | ||
20 | 218 | below it. | ||
21 | 219 | |||
22 | 220 | |||
23 | 206 | Lens Tests | 221 | Lens Tests |
24 | 207 | ============ | 222 | ============ |
25 | 208 | 223 | ||
26 | 209 | 224 | ||
27 | === modified file 'manual-tests/Launcher.txt' | |||
28 | --- manual-tests/Launcher.txt 2012-07-13 15:19:42 +0000 | |||
29 | +++ manual-tests/Launcher.txt 2012-07-26 05:12:23 +0000 | |||
30 | @@ -40,6 +40,21 @@ | |||
31 | 40 | in the last used workspace. | 40 | in the last used workspace. |
32 | 41 | 41 | ||
33 | 42 | 42 | ||
34 | 43 | Test Alt+F1 KeyNavMode Rendering | ||
35 | 44 | -------------------------------- | ||
36 | 45 | This test shows that the launcher is redrawing correctly during Alt+F1 | ||
37 | 46 | KeyNav mode. | ||
38 | 47 | |||
39 | 48 | Action: | ||
40 | 49 | #. Press Alt+F1 to enter keynav mode. | ||
41 | 50 | #. Keep pressing the down arrow key until the highlighted launcher icon is the | ||
42 | 51 | bottom one (usually Trash). | ||
43 | 52 | |||
44 | 53 | Outcome: | ||
45 | 54 | For every Down keypress, the next launcher icon down should be highlighted. | ||
46 | 55 | Verify each icon gets highlighted from top to bottom. | ||
47 | 56 | |||
48 | 57 | |||
49 | 43 | Test Alt+F1 KeyNavMode Mouse Works | 58 | Test Alt+F1 KeyNavMode Mouse Works |
50 | 44 | ------------------------------- | 59 | ------------------------------- |
51 | 45 | This test shows that the mouse still works normally while keynav mode is active. | 60 | This test shows that the mouse still works normally while keynav mode is active. |
52 | 46 | 61 | ||
53 | === modified file 'manual-tests/Panel.txt' | |||
54 | --- manual-tests/Panel.txt 2012-04-05 22:21:55 +0000 | |||
55 | +++ manual-tests/Panel.txt 2012-07-26 05:12:23 +0000 | |||
56 | @@ -69,3 +69,20 @@ | |||
57 | 69 | Expected Result: | 69 | Expected Result: |
58 | 70 | The panel should stay translucent | 70 | The panel should stay translucent |
59 | 71 | 71 | ||
60 | 72 | |||
61 | 73 | Panel (and Launcher) blinking/flickering | ||
62 | 74 | ----------------------------------------- | ||
63 | 75 | Setup: | ||
64 | 76 | #. Optionally install "emacs23" | ||
65 | 77 | |||
66 | 78 | Actions: | ||
67 | 79 | #. Open LibreOffice Impress. | ||
68 | 80 | #. Click on "Click to add title" and "Click to add text" a few times. | ||
69 | 81 | #. Optionally: Run emacs23 | ||
70 | 82 | #. Optionally: Open a large file in emacs23. | ||
71 | 83 | #. Optionally: Scroll to the bottom of the file using Page Down. | ||
72 | 84 | |||
73 | 85 | Outcome: | ||
74 | 86 | At no point during the actions should the panel (or launcher) blink or | ||
75 | 87 | flicker out of existence. | ||
76 | 88 | |||
77 | 72 | 89 | ||
78 | === modified file 'manual-tests/WindowManagement.txt' | |||
79 | --- manual-tests/WindowManagement.txt 2012-03-23 15:14:42 +0000 | |||
80 | +++ manual-tests/WindowManagement.txt 2012-07-26 05:12:23 +0000 | |||
81 | @@ -49,3 +49,23 @@ | |||
82 | 49 | 49 | ||
83 | 50 | Outcome: | 50 | Outcome: |
84 | 51 | The window should be in the maximized state. | 51 | The window should be in the maximized state. |
85 | 52 | |||
86 | 53 | |||
87 | 54 | Fullscreen windows | ||
88 | 55 | -------------------- | ||
89 | 56 | Tests rendering of fullscreen windows. | ||
90 | 57 | |||
91 | 58 | Action: | ||
92 | 59 | #. Set a window to full screen. e.g. F11 in a web browser. | ||
93 | 60 | #. Verify you can scroll the window. | ||
94 | 61 | #. Tap the Super key. | ||
95 | 62 | #. Verify you can still scroll the window. | ||
96 | 63 | |||
97 | 64 | Outcome: | ||
98 | 65 | The fullscreen window should never look corrupt and always be scrollable. | ||
99 | 66 | |||
100 | 67 | Recovery (in case of failure): | ||
101 | 68 | #. Tap the Super key again. | ||
102 | 69 | #. Tap F11 to leave full screen. | ||
103 | 70 | #. Press Super+S twice to force a full screen redraw. | ||
104 | 71 | |||
105 | 52 | 72 | ||
106 | === modified file 'plugins/unityshell/src/AbstractLauncherIcon.h' | |||
107 | --- plugins/unityshell/src/AbstractLauncherIcon.h 2012-07-16 11:03:18 +0000 | |||
108 | +++ plugins/unityshell/src/AbstractLauncherIcon.h 2012-07-26 05:12:23 +0000 | |||
109 | @@ -218,6 +218,7 @@ | |||
110 | 218 | 218 | ||
111 | 219 | sigc::signal<void, AbstractLauncherIcon::Ptr> needs_redraw; | 219 | sigc::signal<void, AbstractLauncherIcon::Ptr> needs_redraw; |
112 | 220 | sigc::signal<void, AbstractLauncherIcon::Ptr> remove; | 220 | sigc::signal<void, AbstractLauncherIcon::Ptr> remove; |
113 | 221 | sigc::signal<void, nux::ObjectPtr<nux::View>> tooltip_visible; | ||
114 | 221 | sigc::signal<void> visibility_changed; | 222 | sigc::signal<void> visibility_changed; |
115 | 222 | 223 | ||
116 | 223 | sigc::connection needs_redraw_connection; | 224 | sigc::connection needs_redraw_connection; |
117 | 224 | 225 | ||
118 | === modified file 'plugins/unityshell/src/Launcher.cpp' | |||
119 | --- plugins/unityshell/src/Launcher.cpp 2012-07-17 16:20:53 +0000 | |||
120 | +++ plugins/unityshell/src/Launcher.cpp 2012-07-26 05:12:23 +0000 | |||
121 | @@ -1655,6 +1655,11 @@ | |||
122 | 1655 | } | 1655 | } |
123 | 1656 | } | 1656 | } |
124 | 1657 | 1657 | ||
125 | 1658 | nux::ObjectPtr<nux::View> Launcher::GetActiveTooltip() const | ||
126 | 1659 | { | ||
127 | 1660 | return _active_tooltip; | ||
128 | 1661 | } | ||
129 | 1662 | |||
130 | 1658 | void | 1663 | void |
131 | 1659 | Launcher::SetActionState(LauncherActionState actionstate) | 1664 | Launcher::SetActionState(LauncherActionState actionstate) |
132 | 1660 | { | 1665 | { |
133 | @@ -1815,6 +1820,7 @@ | |||
134 | 1815 | EnsureAnimation(); | 1820 | EnsureAnimation(); |
135 | 1816 | 1821 | ||
136 | 1817 | icon->needs_redraw.connect(sigc::mem_fun(this, &Launcher::OnIconNeedsRedraw)); | 1822 | icon->needs_redraw.connect(sigc::mem_fun(this, &Launcher::OnIconNeedsRedraw)); |
137 | 1823 | icon->tooltip_visible.connect(sigc::mem_fun(this, &Launcher::OnTooltipVisible)); | ||
138 | 1818 | } | 1824 | } |
139 | 1819 | 1825 | ||
140 | 1820 | void Launcher::OnIconRemoved(AbstractLauncherIcon::Ptr icon) | 1826 | void Launcher::OnIconRemoved(AbstractLauncherIcon::Ptr icon) |
141 | @@ -1891,6 +1897,11 @@ | |||
142 | 1891 | EnsureAnimation(); | 1897 | EnsureAnimation(); |
143 | 1892 | } | 1898 | } |
144 | 1893 | 1899 | ||
145 | 1900 | void Launcher::OnTooltipVisible(nux::ObjectPtr<nux::View> view) | ||
146 | 1901 | { | ||
147 | 1902 | _active_tooltip = view; | ||
148 | 1903 | } | ||
149 | 1904 | |||
150 | 1894 | void Launcher::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) | 1905 | void Launcher::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) |
151 | 1895 | { | 1906 | { |
152 | 1896 | 1907 | ||
153 | 1897 | 1908 | ||
154 | === modified file 'plugins/unityshell/src/Launcher.h' | |||
155 | --- plugins/unityshell/src/Launcher.h 2012-04-17 05:29:12 +0000 | |||
156 | +++ plugins/unityshell/src/Launcher.h 2012-07-26 05:12:23 +0000 | |||
157 | @@ -99,6 +99,8 @@ | |||
158 | 99 | return _parent; | 99 | return _parent; |
159 | 100 | }; | 100 | }; |
160 | 101 | 101 | ||
161 | 102 | nux::ObjectPtr<nux::View> GetActiveTooltip() const; // nullptr = no tooltip | ||
162 | 103 | |||
163 | 102 | virtual void RecvMouseUp(int x, int y, unsigned long button_flags, unsigned long key_flags); | 104 | virtual void RecvMouseUp(int x, int y, unsigned long button_flags, unsigned long key_flags); |
164 | 103 | virtual void RecvMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags); | 105 | virtual void RecvMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags); |
165 | 104 | virtual void RecvMouseDrag(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags); | 106 | virtual void RecvMouseDrag(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags); |
166 | @@ -276,6 +278,7 @@ | |||
167 | 276 | void OnOrderChanged(); | 278 | void OnOrderChanged(); |
168 | 277 | 279 | ||
169 | 278 | void OnIconNeedsRedraw(AbstractLauncherIcon::Ptr icon); | 280 | void OnIconNeedsRedraw(AbstractLauncherIcon::Ptr icon); |
170 | 281 | void OnTooltipVisible(nux::ObjectPtr<nux::View> view); | ||
171 | 279 | 282 | ||
172 | 280 | void OnOverlayHidden(GVariant* data); | 283 | void OnOverlayHidden(GVariant* data); |
173 | 281 | void OnOverlayShown(GVariant* data); | 284 | void OnOverlayShown(GVariant* data); |
174 | @@ -314,6 +317,7 @@ | |||
175 | 314 | 317 | ||
176 | 315 | void DndReset(); | 318 | void DndReset(); |
177 | 316 | void DndHoveredIconReset(); | 319 | void DndHoveredIconReset(); |
178 | 320 | nux::ObjectPtr<nux::View> _active_tooltip; | ||
179 | 317 | 321 | ||
180 | 318 | nux::HLayout* m_Layout; | 322 | nux::HLayout* m_Layout; |
181 | 319 | 323 | ||
182 | 320 | 324 | ||
183 | === modified file 'plugins/unityshell/src/LauncherIcon.cpp' | |||
184 | --- plugins/unityshell/src/LauncherIcon.cpp 2012-07-16 11:03:18 +0000 | |||
185 | +++ plugins/unityshell/src/LauncherIcon.cpp 2012-07-26 05:12:23 +0000 | |||
186 | @@ -524,6 +524,7 @@ | |||
187 | 524 | LoadTooltip(); | 524 | LoadTooltip(); |
188 | 525 | _tooltip->ShowTooltipWithTipAt(tip_x, tip_y); | 525 | _tooltip->ShowTooltipWithTipAt(tip_x, tip_y); |
189 | 526 | _tooltip->ShowWindow(!tooltip_text().empty()); | 526 | _tooltip->ShowWindow(!tooltip_text().empty()); |
190 | 527 | tooltip_visible.emit(_tooltip); | ||
191 | 527 | } | 528 | } |
192 | 528 | 529 | ||
193 | 529 | void | 530 | void |
194 | @@ -545,6 +546,7 @@ | |||
195 | 545 | 546 | ||
196 | 546 | if (_tooltip) | 547 | if (_tooltip) |
197 | 547 | _tooltip->ShowWindow(false); | 548 | _tooltip->ShowWindow(false); |
198 | 549 | tooltip_visible.emit(nux::ObjectPtr<nux::View>(nullptr)); | ||
199 | 548 | } | 550 | } |
200 | 549 | 551 | ||
201 | 550 | bool LauncherIcon::OpenQuicklist(bool select_first_item, int monitor) | 552 | bool LauncherIcon::OpenQuicklist(bool select_first_item, int monitor) |
202 | @@ -663,6 +665,7 @@ | |||
203 | 663 | { | 665 | { |
204 | 664 | if (_tooltip) | 666 | if (_tooltip) |
205 | 665 | _tooltip->ShowWindow(false); | 667 | _tooltip->ShowWindow(false); |
206 | 668 | tooltip_visible.emit(nux::ObjectPtr<nux::View>(nullptr)); | ||
207 | 666 | } | 669 | } |
208 | 667 | 670 | ||
209 | 668 | gboolean | 671 | gboolean |
210 | 669 | 672 | ||
211 | === modified file 'plugins/unityshell/src/PanelController.cpp' | |||
212 | --- plugins/unityshell/src/PanelController.cpp 2012-04-04 20:21:45 +0000 | |||
213 | +++ plugins/unityshell/src/PanelController.cpp 2012-07-26 05:12:23 +0000 | |||
214 | @@ -48,6 +48,7 @@ | |||
215 | 48 | void QueueRedraw(); | 48 | void QueueRedraw(); |
216 | 49 | 49 | ||
217 | 50 | std::vector<Window> GetTrayXids() const; | 50 | std::vector<Window> GetTrayXids() const; |
218 | 51 | std::vector<nux::View*> GetPanelViews() const; | ||
219 | 51 | std::vector<nux::Geometry> GetGeometries() const; | 52 | std::vector<nux::Geometry> GetGeometries() const; |
220 | 52 | 53 | ||
221 | 53 | // NOTE: nux::Property maybe? | 54 | // NOTE: nux::Property maybe? |
222 | @@ -111,6 +112,15 @@ | |||
223 | 111 | return xids; | 112 | return xids; |
224 | 112 | } | 113 | } |
225 | 113 | 114 | ||
226 | 115 | std::vector<nux::View*> Controller::Impl::GetPanelViews() const | ||
227 | 116 | { | ||
228 | 117 | std::vector<nux::View*> views; | ||
229 | 118 | views.reserve(windows_.size()); | ||
230 | 119 | for (auto window: windows_) | ||
231 | 120 | views.push_back(ViewForWindow(window)); | ||
232 | 121 | return views; | ||
233 | 122 | } | ||
234 | 123 | |||
235 | 114 | std::vector<nux::Geometry> Controller::Impl::GetGeometries() const | 124 | std::vector<nux::Geometry> Controller::Impl::GetGeometries() const |
236 | 115 | { | 125 | { |
237 | 116 | std::vector<nux::Geometry> geometries; | 126 | std::vector<nux::Geometry> geometries; |
238 | @@ -337,6 +347,11 @@ | |||
239 | 337 | return pimpl->GetTrayXids(); | 347 | return pimpl->GetTrayXids(); |
240 | 338 | } | 348 | } |
241 | 339 | 349 | ||
242 | 350 | std::vector<nux::View*> Controller::GetPanelViews() const | ||
243 | 351 | { | ||
244 | 352 | return pimpl->GetPanelViews(); | ||
245 | 353 | } | ||
246 | 354 | |||
247 | 340 | std::vector<nux::Geometry> Controller::GetGeometries() const | 355 | std::vector<nux::Geometry> Controller::GetGeometries() const |
248 | 341 | { | 356 | { |
249 | 342 | return pimpl->GetGeometries(); | 357 | return pimpl->GetGeometries(); |
250 | 343 | 358 | ||
251 | === modified file 'plugins/unityshell/src/PanelController.h' | |||
252 | --- plugins/unityshell/src/PanelController.h 2012-04-02 14:02:29 +0000 | |||
253 | +++ plugins/unityshell/src/PanelController.h 2012-07-26 05:12:23 +0000 | |||
254 | @@ -41,6 +41,7 @@ | |||
255 | 41 | void QueueRedraw(); | 41 | void QueueRedraw(); |
256 | 42 | 42 | ||
257 | 43 | std::vector<Window> GetTrayXids() const; | 43 | std::vector<Window> GetTrayXids() const; |
258 | 44 | std::vector<nux::View*> GetPanelViews() const; | ||
259 | 44 | std::vector<nux::Geometry> GetGeometries() const; | 45 | std::vector<nux::Geometry> GetGeometries() const; |
260 | 45 | 46 | ||
261 | 46 | // NOTE: nux::Property maybe? | 47 | // NOTE: nux::Property maybe? |
262 | 47 | 48 | ||
263 | === modified file 'plugins/unityshell/src/unityshell.cpp' | |||
264 | --- plugins/unityshell/src/unityshell.cpp 2012-07-13 17:56:23 +0000 | |||
265 | +++ plugins/unityshell/src/unityshell.cpp 2012-07-26 05:12:23 +0000 | |||
266 | @@ -115,8 +115,8 @@ | |||
267 | 115 | , _redraw_handle(0) | 115 | , _redraw_handle(0) |
268 | 116 | , newFocusedWindow(nullptr) | 116 | , newFocusedWindow(nullptr) |
269 | 117 | , doShellRepaint(false) | 117 | , doShellRepaint(false) |
270 | 118 | , didShellRepaint(false) | ||
271 | 118 | , allowWindowPaint(false) | 119 | , allowWindowPaint(false) |
272 | 119 | , damaged(false) | ||
273 | 120 | , _key_nav_mode_requested(false) | 120 | , _key_nav_mode_requested(false) |
274 | 121 | , _last_output(nullptr) | 121 | , _last_output(nullptr) |
275 | 122 | #ifndef USE_GLES | 122 | #ifndef USE_GLES |
276 | @@ -911,13 +911,14 @@ | |||
277 | 911 | } | 911 | } |
278 | 912 | 912 | ||
279 | 913 | doShellRepaint = false; | 913 | doShellRepaint = false; |
281 | 914 | damaged = false; | 914 | didShellRepaint = true; |
282 | 915 | } | 915 | } |
283 | 916 | 916 | ||
284 | 917 | bool UnityScreen::forcePaintOnTop () | 917 | bool UnityScreen::forcePaintOnTop () |
285 | 918 | { | 918 | { |
286 | 919 | return !allowWindowPaint || | 919 | return !allowWindowPaint || |
288 | 920 | ((switcher_controller_->Visible() || launcher_controller_->IsOverlayOpen()) | 920 | ((switcher_controller_->Visible() || |
289 | 921 | PluginAdapter::Default()->IsExpoActive()) | ||
290 | 921 | && !fullscreen_windows_.empty () && (!(screen->grabbed () && !screen->otherGrabExist (NULL)))); | 922 | && !fullscreen_windows_.empty () && (!(screen->grabbed () && !screen->otherGrabExist (NULL)))); |
291 | 922 | } | 923 | } |
292 | 923 | 924 | ||
293 | @@ -1204,6 +1205,42 @@ | |||
294 | 1204 | } | 1205 | } |
295 | 1205 | } | 1206 | } |
296 | 1206 | 1207 | ||
297 | 1208 | bool UnityScreen::shellCouldBeHidden(CompOutput const& output) | ||
298 | 1209 | { | ||
299 | 1210 | std::vector<Window> const& nuxwins(nux::XInputWindow::NativeHandleList()); | ||
300 | 1211 | |||
301 | 1212 | // Loop through windows from front to back | ||
302 | 1213 | CompWindowList const& wins = screen->windows(); | ||
303 | 1214 | for ( CompWindowList::const_reverse_iterator r = wins.rbegin() | ||
304 | 1215 | ; r != wins.rend() | ||
305 | 1216 | ; r++ | ||
306 | 1217 | ) | ||
307 | 1218 | { | ||
308 | 1219 | CompWindow* w = *r; | ||
309 | 1220 | |||
310 | 1221 | /* | ||
311 | 1222 | * The shell is hidden if there exists any window that fully covers | ||
312 | 1223 | * the output and is in front of all Nux windows on that output. | ||
313 | 1224 | */ | ||
314 | 1225 | if (w->isMapped() && | ||
315 | 1226 | !(w->state () & CompWindowStateHiddenMask) && | ||
316 | 1227 | w->geometry().contains(output)) | ||
317 | 1228 | { | ||
318 | 1229 | return true; | ||
319 | 1230 | } | ||
320 | 1231 | else | ||
321 | 1232 | { | ||
322 | 1233 | for (Window n : nuxwins) | ||
323 | 1234 | { | ||
324 | 1235 | if (w->id() == n && output.intersects(w->geometry())) | ||
325 | 1236 | return false; | ||
326 | 1237 | } | ||
327 | 1238 | } | ||
328 | 1239 | } | ||
329 | 1240 | |||
330 | 1241 | return false; | ||
331 | 1242 | } | ||
332 | 1243 | |||
333 | 1207 | /* called whenever we need to repaint parts of the screen */ | 1244 | /* called whenever we need to repaint parts of the screen */ |
334 | 1208 | bool UnityScreen::glPaintOutput(const GLScreenPaintAttrib& attrib, | 1245 | bool UnityScreen::glPaintOutput(const GLScreenPaintAttrib& attrib, |
335 | 1209 | const GLMatrix& transform, | 1246 | const GLMatrix& transform, |
336 | @@ -1213,7 +1250,20 @@ | |||
337 | 1213 | { | 1250 | { |
338 | 1214 | bool ret; | 1251 | bool ret; |
339 | 1215 | 1252 | ||
341 | 1216 | doShellRepaint = true; | 1253 | /* |
342 | 1254 | * Very important! | ||
343 | 1255 | * Don't waste GPU and CPU rendering the shell on every frame if you don't | ||
344 | 1256 | * need to. Doing so on every frame causes Nux to hog the GPU and slow down | ||
345 | 1257 | * ALL rendering. (LP: #988079) | ||
346 | 1258 | */ | ||
347 | 1259 | bool force = forcePaintOnTop(); | ||
348 | 1260 | doShellRepaint = force || | ||
349 | 1261 | ( !region.isEmpty() && | ||
350 | 1262 | ( !wt->GetDrawList().empty() || | ||
351 | 1263 | (mask & PAINT_SCREEN_FULL_MASK) | ||
352 | 1264 | ) | ||
353 | 1265 | ); | ||
354 | 1266 | |||
355 | 1217 | allowWindowPaint = true; | 1267 | allowWindowPaint = true; |
356 | 1218 | _last_output = output; | 1268 | _last_output = output; |
357 | 1219 | paint_panel_ = false; | 1269 | paint_panel_ = false; |
358 | @@ -1228,14 +1278,27 @@ | |||
359 | 1228 | * once an fbo is bound any further | 1278 | * once an fbo is bound any further |
360 | 1229 | * attempts to bind it will only increment | 1279 | * attempts to bind it will only increment |
361 | 1230 | * its bind reference so make sure that | 1280 | * its bind reference so make sure that |
364 | 1231 | * you always unbind as much as you bind */ | 1281 | * you always unbind as much as you bind |
365 | 1232 | _fbo->bind (nux::Geometry (output->x (), output->y (), output->width (), output->height ())); | 1282 | * |
366 | 1283 | * But NOTE: It is only safe to bind the FBO if !shellCouldBeHidden. | ||
367 | 1284 | * Otherwise it's possible painting won't occur and that would | ||
368 | 1285 | * confuse the state of the FBO. | ||
369 | 1286 | */ | ||
370 | 1287 | if (doShellRepaint && !shellCouldBeHidden(*output)) | ||
371 | 1288 | _fbo->bind (nux::Geometry (output->x (), output->y (), output->width (), output->height ())); | ||
372 | 1233 | #endif | 1289 | #endif |
373 | 1234 | 1290 | ||
374 | 1291 | // CompRegion has no clear() method. So this is the fastest alternative. | ||
375 | 1292 | fullscreenRegion = CompRegion(); | ||
376 | 1293 | nuxRegion = CompRegion(); | ||
377 | 1294 | |||
378 | 1235 | /* glPaintOutput is part of the opengl plugin, so we need the GLScreen base class. */ | 1295 | /* glPaintOutput is part of the opengl plugin, so we need the GLScreen base class. */ |
379 | 1236 | ret = gScreen->glPaintOutput(attrib, transform, region, output, mask); | 1296 | ret = gScreen->glPaintOutput(attrib, transform, region, output, mask); |
380 | 1237 | 1297 | ||
381 | 1238 | #ifndef USE_GLES | 1298 | #ifndef USE_GLES |
382 | 1299 | if (doShellRepaint && !force && fullscreenRegion.contains(*output)) | ||
383 | 1300 | doShellRepaint = false; | ||
384 | 1301 | |||
385 | 1239 | if (doShellRepaint) | 1302 | if (doShellRepaint) |
386 | 1240 | paintDisplay(region, transform, mask); | 1303 | paintDisplay(region, transform, mask); |
387 | 1241 | #endif | 1304 | #endif |
388 | @@ -1288,16 +1351,26 @@ | |||
389 | 1288 | for (ShowdesktopHandlerWindowInterface *wi : ShowdesktopHandler::animating_windows) | 1351 | for (ShowdesktopHandlerWindowInterface *wi : ShowdesktopHandler::animating_windows) |
390 | 1289 | wi->HandleAnimations (ms); | 1352 | wi->HandleAnimations (ms); |
391 | 1290 | 1353 | ||
397 | 1291 | if (damaged) | 1354 | compizDamageNux(cScreen->currentDamage()); |
393 | 1292 | { | ||
394 | 1293 | damaged = false; | ||
395 | 1294 | damageNuxRegions(); | ||
396 | 1295 | } | ||
398 | 1296 | 1355 | ||
399 | 1356 | didShellRepaint = false; | ||
400 | 1357 | firstWindowAboveShell = NULL; | ||
401 | 1297 | } | 1358 | } |
402 | 1298 | 1359 | ||
403 | 1299 | void UnityScreen::donePaint() | 1360 | void UnityScreen::donePaint() |
404 | 1300 | { | 1361 | { |
405 | 1362 | /* | ||
406 | 1363 | * It's only safe to clear the draw list if drawing actually occurred | ||
407 | 1364 | * (i.e. the shell was not obscured behind a fullscreen window). | ||
408 | 1365 | * If you clear the draw list and drawing has not occured then you'd be | ||
409 | 1366 | * left with all your views thinking they're queued for drawing still and | ||
410 | 1367 | * would refuse to redraw when you return from fullscreen. | ||
411 | 1368 | * I think this is a Nux bug. ClearDrawList should ideally also mark all | ||
412 | 1369 | * the queued views as draw_cmd_queued_=false. | ||
413 | 1370 | */ | ||
414 | 1371 | if (didShellRepaint) | ||
415 | 1372 | wt->ClearDrawList(); | ||
416 | 1373 | |||
417 | 1301 | std::list <ShowdesktopHandlerWindowInterface *> remove_windows; | 1374 | std::list <ShowdesktopHandlerWindowInterface *> remove_windows; |
418 | 1302 | 1375 | ||
419 | 1303 | for (ShowdesktopHandlerWindowInterface *wi : ShowdesktopHandler::animating_windows) | 1376 | for (ShowdesktopHandlerWindowInterface *wi : ShowdesktopHandler::animating_windows) |
420 | @@ -1318,35 +1391,116 @@ | |||
421 | 1318 | cScreen->donePaint (); | 1391 | cScreen->donePaint (); |
422 | 1319 | } | 1392 | } |
423 | 1320 | 1393 | ||
424 | 1394 | void UnityScreen::compizDamageNux(CompRegion const& damage) | ||
425 | 1395 | { | ||
426 | 1396 | if (!launcher_controller_) | ||
427 | 1397 | return; | ||
428 | 1398 | |||
429 | 1399 | /* | ||
430 | 1400 | * Prioritise user interaction over active blur updates. So the general | ||
431 | 1401 | * slowness of the active blur doesn't affect the UI interaction performance. | ||
432 | 1402 | * | ||
433 | 1403 | * Also, BackgroundEffectHelper::ProcessDamage() is causing a feedback loop | ||
434 | 1404 | * while the dash is open. Calling it results in the NEXT frame (and the | ||
435 | 1405 | * current one?) to get some damage. This GetDrawList().empty() check avoids | ||
436 | 1406 | * that feedback loop and allows us to idle correctly. | ||
437 | 1407 | */ | ||
438 | 1408 | if (wt->GetDrawList().empty()) | ||
439 | 1409 | { | ||
440 | 1410 | CompRect::vector const& rects(damage.rects()); | ||
441 | 1411 | for (CompRect const& r : rects) | ||
442 | 1412 | { | ||
443 | 1413 | nux::Geometry geo(r.x(), r.y(), r.width(), r.height()); | ||
444 | 1414 | BackgroundEffectHelper::ProcessDamage(geo); | ||
445 | 1415 | } | ||
446 | 1416 | } | ||
447 | 1417 | |||
448 | 1418 | auto launchers = launcher_controller_->launchers(); | ||
449 | 1419 | for (auto launcher : launchers) | ||
450 | 1420 | { | ||
451 | 1421 | if (!launcher->Hidden()) | ||
452 | 1422 | { | ||
453 | 1423 | nux::Geometry geo = launcher->GetAbsoluteGeometry(); | ||
454 | 1424 | CompRegion launcher_region(geo.x, geo.y, geo.width, geo.height); | ||
455 | 1425 | if (damage.intersects(launcher_region)) | ||
456 | 1426 | launcher->QueueDraw(); | ||
457 | 1427 | nux::ObjectPtr<nux::View> tooltip = launcher->GetActiveTooltip(); | ||
458 | 1428 | if (!tooltip.IsNull()) | ||
459 | 1429 | { | ||
460 | 1430 | nux::Geometry tip = tooltip->GetAbsoluteGeometry(); | ||
461 | 1431 | CompRegion tip_region(tip.x, tip.y, tip.width, tip.height); | ||
462 | 1432 | if (damage.intersects(tip_region)) | ||
463 | 1433 | tooltip->QueueDraw(); | ||
464 | 1434 | } | ||
465 | 1435 | } | ||
466 | 1436 | } | ||
467 | 1437 | |||
468 | 1438 | std::vector<nux::View*> const& panels(panel_controller_->GetPanelViews()); | ||
469 | 1439 | for (nux::View* view : panels) | ||
470 | 1440 | { | ||
471 | 1441 | nux::Geometry geo = view->GetAbsoluteGeometry(); | ||
472 | 1442 | CompRegion panel_region(geo.x, geo.y, geo.width, geo.height); | ||
473 | 1443 | if (damage.intersects(panel_region)) | ||
474 | 1444 | view->QueueDraw(); | ||
475 | 1445 | } | ||
476 | 1446 | |||
477 | 1447 | QuicklistManager* qm = QuicklistManager::Default(); | ||
478 | 1448 | if (qm) | ||
479 | 1449 | { | ||
480 | 1450 | QuicklistView* view = qm->Current(); | ||
481 | 1451 | if (view) | ||
482 | 1452 | { | ||
483 | 1453 | nux::Geometry geo = view->GetAbsoluteGeometry(); | ||
484 | 1454 | CompRegion quicklist_region(geo.x, geo.y, geo.width, geo.height); | ||
485 | 1455 | if (damage.intersects(quicklist_region)) | ||
486 | 1456 | view->QueueDraw(); | ||
487 | 1457 | } | ||
488 | 1458 | } | ||
489 | 1459 | } | ||
490 | 1460 | |||
491 | 1321 | /* Grab changed nux regions and add damage rects for them */ | 1461 | /* Grab changed nux regions and add damage rects for them */ |
493 | 1322 | void UnityScreen::damageNuxRegions() | 1462 | void UnityScreen::nuxDamageCompiz() |
494 | 1323 | { | 1463 | { |
495 | 1464 | /* | ||
496 | 1465 | * WARNING: Nux bug LP: #1014610 (unbounded DrawList growth) will cause | ||
497 | 1466 | * this code to be called far too often in some cases and | ||
498 | 1467 | * Unity will appear to freeze for a while. Please ensure you | ||
499 | 1468 | * have Nux 3.0+ with the fix for LP: #1014610. | ||
500 | 1469 | */ | ||
501 | 1470 | |||
502 | 1471 | if (!launcher_controller_ || !dash_controller_) | ||
503 | 1472 | return; | ||
504 | 1473 | |||
505 | 1324 | CompRegion nux_damage; | 1474 | CompRegion nux_damage; |
506 | 1325 | 1475 | ||
526 | 1326 | if (damaged) | 1476 | std::vector<nux::Geometry> const& dirty = wt->GetDrawList(); |
527 | 1327 | return; | 1477 | for (auto geo : dirty) |
528 | 1328 | 1478 | nux_damage += CompRegion(geo.x, geo.y, geo.width, geo.height); | |
529 | 1329 | std::vector<nux::Geometry> dirty = wt->GetDrawList(); | 1479 | |
530 | 1330 | damaged = true; | 1480 | if (launcher_controller_->IsOverlayOpen()) |
531 | 1331 | 1481 | { | |
532 | 1332 | for (std::vector<nux::Geometry>::iterator it = dirty.begin(), end = dirty.end(); | 1482 | nux::BaseWindow* dash_window = dash_controller_->window(); |
533 | 1333 | it != end; ++it) | 1483 | nux::Geometry const& geo = dash_window->GetAbsoluteGeometry(); |
534 | 1334 | { | 1484 | nux_damage += CompRegion(geo.x, geo.y, geo.width, geo.height); |
535 | 1335 | nux::Geometry const& geo = *it; | 1485 | } |
536 | 1336 | nux_damage += CompRegion(geo.x, geo.y, geo.width, geo.height); | 1486 | |
537 | 1337 | } | 1487 | auto launchers = launcher_controller_->launchers(); |
538 | 1338 | 1488 | for (auto launcher : launchers) | |
539 | 1339 | nux::Geometry geo = wt->GetWindowCompositor().GetTooltipMainWindowGeometry(); | 1489 | { |
540 | 1340 | nux_damage += CompRegion(geo.x, geo.y, geo.width, geo.height); | 1490 | if (!launcher->Hidden()) |
541 | 1341 | 1491 | { | |
542 | 1342 | geo = lastTooltipArea; | 1492 | nux::ObjectPtr<nux::View> tooltip = launcher->GetActiveTooltip(); |
543 | 1343 | nux_damage += CompRegion(lastTooltipArea.x, lastTooltipArea.y, | 1493 | if (!tooltip.IsNull()) |
544 | 1344 | lastTooltipArea.width, lastTooltipArea.height); | 1494 | { |
545 | 1495 | nux::Geometry const& g = tooltip->GetAbsoluteGeometry(); | ||
546 | 1496 | nux_damage += CompRegion(g.x, g.y, g.width, g.height); | ||
547 | 1497 | } | ||
548 | 1498 | } | ||
549 | 1499 | } | ||
550 | 1500 | |||
551 | 1501 | cScreen->damageRegionSetEnabled(this, false); | ||
552 | 1345 | cScreen->damageRegion(nux_damage); | 1502 | cScreen->damageRegion(nux_damage); |
557 | 1346 | 1503 | cScreen->damageRegionSetEnabled(this, true); | |
554 | 1347 | wt->ClearDrawList(); | ||
555 | 1348 | |||
556 | 1349 | lastTooltipArea = geo; | ||
558 | 1350 | } | 1504 | } |
559 | 1351 | 1505 | ||
560 | 1352 | /* handle X Events */ | 1506 | /* handle X Events */ |
561 | @@ -1502,44 +1656,12 @@ | |||
562 | 1502 | { | 1656 | { |
563 | 1503 | wt->ProcessForeignEvent(event, NULL); | 1657 | wt->ProcessForeignEvent(event, NULL); |
564 | 1504 | } | 1658 | } |
603 | 1505 | 1659 | } | |
604 | 1506 | if (event->type == cScreen->damageEvent() + XDamageNotify) | 1660 | |
605 | 1507 | { | 1661 | void UnityScreen::damageRegion(const CompRegion ®ion) |
606 | 1508 | XDamageNotifyEvent *de = (XDamageNotifyEvent *) event; | 1662 | { |
607 | 1509 | CompWindow* w = screen->findWindow (de->drawable); | 1663 | compizDamageNux(region); |
608 | 1510 | std::vector<Window> const& xwns = nux::XInputWindow::NativeHandleList(); | 1664 | cScreen->damageRegion(region); |
571 | 1511 | CompWindow* lastNWindow = screen->findWindow (xwns.back ()); | ||
572 | 1512 | bool processDamage = true; | ||
573 | 1513 | |||
574 | 1514 | if (w) | ||
575 | 1515 | { | ||
576 | 1516 | if (!w->overrideRedirect () && | ||
577 | 1517 | w->isViewable () && | ||
578 | 1518 | !w->invisible ()) | ||
579 | 1519 | { | ||
580 | 1520 | |||
581 | 1521 | for (; lastNWindow != NULL; lastNWindow = lastNWindow->next) | ||
582 | 1522 | { | ||
583 | 1523 | if (lastNWindow == w) | ||
584 | 1524 | { | ||
585 | 1525 | processDamage = false; | ||
586 | 1526 | break; | ||
587 | 1527 | } | ||
588 | 1528 | } | ||
589 | 1529 | |||
590 | 1530 | if (processDamage) | ||
591 | 1531 | { | ||
592 | 1532 | nux::Geometry damage (de->area.x, de->area.y, de->area.width, de->area.height); | ||
593 | 1533 | |||
594 | 1534 | const CompWindow::Geometry &geom = w->geometry (); | ||
595 | 1535 | damage.x += geom.x () + geom.border (); | ||
596 | 1536 | damage.y += geom.y () + geom.border (); | ||
597 | 1537 | |||
598 | 1538 | BackgroundEffectHelper::ProcessDamage(damage); | ||
599 | 1539 | } | ||
600 | 1540 | } | ||
601 | 1541 | } | ||
602 | 1542 | } | ||
609 | 1543 | } | 1665 | } |
610 | 1544 | 1666 | ||
611 | 1545 | void UnityScreen::handleCompizEvent(const char* plugin, | 1667 | void UnityScreen::handleCompizEvent(const char* plugin, |
612 | @@ -2195,14 +2317,6 @@ | |||
613 | 2195 | return false; | 2317 | return false; |
614 | 2196 | } | 2318 | } |
615 | 2197 | 2319 | ||
616 | 2198 | const CompWindowList& UnityScreen::getWindowPaintList() | ||
617 | 2199 | { | ||
618 | 2200 | CompWindowList& pl = _withRemovedNuxWindows = cScreen->getWindowPaintList(); | ||
619 | 2201 | pl.remove_if(isNuxWindow); | ||
620 | 2202 | |||
621 | 2203 | return pl; | ||
622 | 2204 | } | ||
623 | 2205 | |||
624 | 2206 | void UnityScreen::RaiseInputWindows() | 2320 | void UnityScreen::RaiseInputWindows() |
625 | 2207 | { | 2321 | { |
626 | 2208 | std::vector<Window> const& xwns = nux::XInputWindow::NativeHandleList(); | 2322 | std::vector<Window> const& xwns = nux::XInputWindow::NativeHandleList(); |
627 | @@ -2227,6 +2341,42 @@ | |||
628 | 2227 | const CompRegion& region, | 2341 | const CompRegion& region, |
629 | 2228 | unsigned int mask) | 2342 | unsigned int mask) |
630 | 2229 | { | 2343 | { |
631 | 2344 | /* | ||
632 | 2345 | * The occlusion pass tests windows from TOP to BOTTOM. That's opposite to | ||
633 | 2346 | * the actual painting loop. | ||
634 | 2347 | * | ||
635 | 2348 | * Detect uScreen->fullscreenRegion here. That represents the region which | ||
636 | 2349 | * fully covers the shell on its output. It does not include regular windows | ||
637 | 2350 | * stacked above the shell like DnD icons or Onboard etc. | ||
638 | 2351 | */ | ||
639 | 2352 | if (isNuxWindow(window)) | ||
640 | 2353 | { | ||
641 | 2354 | if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK) | ||
642 | 2355 | { | ||
643 | 2356 | uScreen->nuxRegion += window->geometry(); | ||
644 | 2357 | uScreen->nuxRegion -= uScreen->fullscreenRegion; | ||
645 | 2358 | } | ||
646 | 2359 | return false; // Ensure nux windows are never painted by compiz | ||
647 | 2360 | } | ||
648 | 2361 | else if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK) | ||
649 | 2362 | { | ||
650 | 2363 | static const unsigned int nonOcclusionBits = | ||
651 | 2364 | PAINT_WINDOW_TRANSLUCENT_MASK | | ||
652 | 2365 | PAINT_WINDOW_TRANSFORMED_MASK | | ||
653 | 2366 | PAINT_WINDOW_NO_CORE_INSTANCE_MASK; | ||
654 | 2367 | if (!(mask & nonOcclusionBits) && | ||
655 | 2368 | (window->state() & CompWindowStateFullscreenMask)) | ||
656 | 2369 | // And I've been advised to test other things, but they don't work: | ||
657 | 2370 | // && (attrib.opacity == OPAQUE)) <-- Doesn't work; Only set in glDraw | ||
658 | 2371 | // && !window->alpha() <-- Doesn't work; Opaque windows often have alpha | ||
659 | 2372 | { | ||
660 | 2373 | uScreen->fullscreenRegion += window->geometry(); | ||
661 | 2374 | uScreen->fullscreenRegion -= uScreen->nuxRegion; | ||
662 | 2375 | } | ||
663 | 2376 | if (uScreen->nuxRegion.isEmpty()) | ||
664 | 2377 | uScreen->firstWindowAboveShell = window; | ||
665 | 2378 | } | ||
666 | 2379 | |||
667 | 2230 | GLWindowPaintAttrib wAttrib = attrib; | 2380 | GLWindowPaintAttrib wAttrib = attrib; |
668 | 2231 | 2381 | ||
669 | 2232 | if (mMinimizeHandler) | 2382 | if (mMinimizeHandler) |
670 | @@ -2285,28 +2435,17 @@ | |||
671 | 2285 | } | 2435 | } |
672 | 2286 | } | 2436 | } |
673 | 2287 | 2437 | ||
675 | 2288 | if (uScreen->doShellRepaint && !uScreen->forcePaintOnTop ()) | 2438 | if (uScreen->doShellRepaint && |
676 | 2439 | !uScreen->forcePaintOnTop () && | ||
677 | 2440 | window == uScreen->firstWindowAboveShell && | ||
678 | 2441 | !uScreen->fullscreenRegion.contains(window->geometry()) | ||
679 | 2442 | ) | ||
680 | 2289 | { | 2443 | { |
681 | 2290 | std::vector<Window> const& xwns = nux::XInputWindow::NativeHandleList(); | ||
682 | 2291 | unsigned int size = xwns.size(); | ||
683 | 2292 | |||
684 | 2293 | for (CompWindow* w = window; w && uScreen->doShellRepaint; w = w->prev) | ||
685 | 2294 | { | ||
686 | 2295 | auto id = w->id(); | ||
687 | 2296 | |||
688 | 2297 | for (unsigned int i = 0; i < size; ++i) | ||
689 | 2298 | { | ||
690 | 2299 | if (xwns[i] == id) | ||
691 | 2300 | { | ||
692 | 2301 | #ifdef USE_GLES | 2444 | #ifdef USE_GLES |
694 | 2302 | uScreen->paintDisplay(); | 2445 | uScreen->paintDisplay(); |
695 | 2303 | #else | 2446 | #else |
697 | 2304 | uScreen->paintDisplay(region, matrix, mask); | 2447 | uScreen->paintDisplay(region, matrix, mask); |
698 | 2305 | #endif | 2448 | #endif |
699 | 2306 | break; | ||
700 | 2307 | } | ||
701 | 2308 | } | ||
702 | 2309 | } | ||
703 | 2310 | } | 2449 | } |
704 | 2311 | 2450 | ||
705 | 2312 | if (window->type() == CompWindowTypeDesktopMask) | 2451 | if (window->type() == CompWindowTypeDesktopMask) |
706 | @@ -2611,17 +2750,7 @@ | |||
707 | 2611 | 2750 | ||
708 | 2612 | void UnityScreen::onRedrawRequested() | 2751 | void UnityScreen::onRedrawRequested() |
709 | 2613 | { | 2752 | { |
721 | 2614 | // disable blur updates so we dont waste perf. This can stall the blur during animations | 2753 | nuxDamageCompiz(); |
711 | 2615 | // but ensures a smooth animation. | ||
712 | 2616 | if (_in_paint) | ||
713 | 2617 | { | ||
714 | 2618 | if (!_redraw_handle) | ||
715 | 2619 | _redraw_handle = g_idle_add_full (G_PRIORITY_DEFAULT, &UnityScreen::OnRedrawTimeout, this, NULL); | ||
716 | 2620 | } | ||
717 | 2621 | else | ||
718 | 2622 | { | ||
719 | 2623 | damageNuxRegions(); | ||
720 | 2624 | } | ||
722 | 2625 | } | 2754 | } |
723 | 2626 | 2755 | ||
724 | 2627 | /* Handle option changes and plug that into nux windows */ | 2756 | /* Handle option changes and plug that into nux windows */ |
725 | 2628 | 2757 | ||
726 | === modified file 'plugins/unityshell/src/unityshell.h' | |||
727 | --- plugins/unityshell/src/unityshell.h 2012-06-27 01:19:32 +0000 | |||
728 | +++ plugins/unityshell/src/unityshell.h 2012-07-26 05:12:23 +0000 | |||
729 | @@ -111,6 +111,9 @@ | |||
730 | 111 | const char *eventName, | 111 | const char *eventName, |
731 | 112 | CompOption::Vector &o); | 112 | CompOption::Vector &o); |
732 | 113 | 113 | ||
733 | 114 | void damageRegion(const CompRegion ®ion); | ||
734 | 115 | |||
735 | 116 | bool shellCouldBeHidden(CompOutput const& output); | ||
736 | 114 | 117 | ||
737 | 115 | /* paint on top of all windows if we could not find a window | 118 | /* paint on top of all windows if we could not find a window |
738 | 116 | * to paint underneath */ | 119 | * to paint underneath */ |
739 | @@ -132,9 +135,6 @@ | |||
740 | 132 | CompOutput*, | 135 | CompOutput*, |
741 | 133 | unsigned int); | 136 | unsigned int); |
742 | 134 | 137 | ||
743 | 135 | /* Pop our InputOutput windows from the paint list */ | ||
744 | 136 | const CompWindowList& getWindowPaintList(); | ||
745 | 137 | |||
746 | 138 | /* handle X11 events */ | 138 | /* handle X11 events */ |
747 | 139 | void handleEvent(XEvent*); | 139 | void handleEvent(XEvent*); |
748 | 140 | 140 | ||
749 | @@ -211,7 +211,10 @@ | |||
750 | 211 | 211 | ||
751 | 212 | static gboolean initPluginActions(gpointer data); | 212 | static gboolean initPluginActions(gpointer data); |
752 | 213 | void initLauncher(); | 213 | void initLauncher(); |
754 | 214 | void damageNuxRegions(); | 214 | |
755 | 215 | void compizDamageNux(CompRegion const& region); | ||
756 | 216 | void nuxDamageCompiz(); | ||
757 | 217 | |||
758 | 215 | void onRedrawRequested(); | 218 | void onRedrawRequested(); |
759 | 216 | void Relayout(); | 219 | void Relayout(); |
760 | 217 | 220 | ||
761 | @@ -261,7 +264,6 @@ | |||
762 | 261 | bool enable_shortcut_overlay_; | 264 | bool enable_shortcut_overlay_; |
763 | 262 | 265 | ||
764 | 263 | std::unique_ptr<GestureEngine> gesture_engine_; | 266 | std::unique_ptr<GestureEngine> gesture_engine_; |
765 | 264 | nux::Geometry lastTooltipArea; | ||
766 | 265 | bool needsRelayout; | 267 | bool needsRelayout; |
767 | 266 | bool _in_paint; | 268 | bool _in_paint; |
768 | 267 | guint32 relayoutSourceId; | 269 | guint32 relayoutSourceId; |
769 | @@ -280,11 +282,14 @@ | |||
770 | 280 | 282 | ||
771 | 281 | /* handle paint order */ | 283 | /* handle paint order */ |
772 | 282 | bool doShellRepaint; | 284 | bool doShellRepaint; |
773 | 285 | bool didShellRepaint; | ||
774 | 283 | bool allowWindowPaint; | 286 | bool allowWindowPaint; |
775 | 284 | bool damaged; | ||
776 | 285 | bool _key_nav_mode_requested; | 287 | bool _key_nav_mode_requested; |
777 | 286 | CompOutput* _last_output; | 288 | CompOutput* _last_output; |
779 | 287 | CompWindowList _withRemovedNuxWindows; | 289 | |
780 | 290 | CompRegion nuxRegion; | ||
781 | 291 | CompRegion fullscreenRegion; | ||
782 | 292 | CompWindow* firstWindowAboveShell; | ||
783 | 288 | 293 | ||
784 | 289 | nux::Property<nux::Geometry> primary_monitor_; | 294 | nux::Property<nux::Geometry> primary_monitor_; |
785 | 290 | 295 |
Please note: This proposal has two external prerequisite fixes:
bug 1012956 (already fixed in lp:compiz-core/0.9.7)
bug 1014610 (already fixed in lp:nux/2.0)
It appears neither of these fixes have hit ubuntu yet.