Merge lp:~unity-team/unity/x-sru3 into lp:unity/7.4
- x-sru3
- Merge into xenial
Proposed by
Marco Trevisan (Treviño)
Status: | Merged |
---|---|
Approved by: | Andrea Azzarone |
Approved revision: | no longer in the source branch. |
Merged at revision: | 4111 |
Proposed branch: | lp:~unity-team/unity/x-sru3 |
Merge into: | lp:unity/7.4 |
Diff against target: |
1128 lines (+505/-85) 35 files modified
CMakeLists.txt (+6/-0) debian/changelog (+35/-0) debian/control (+1/-0) debian/libunity-core-6.0-9.install (+1/-1) debian/unity-services.install (+1/-1) debian/unity.install (+1/-0) decorations/CMakeLists.txt (+1/-0) decorations/DecoratedWindow.cpp (+101/-5) decorations/DecoratedWindow.h (+1/-0) decorations/DecorationsManager.cpp (+1/-1) decorations/DecorationsPriv.h (+8/-0) decorations/DecorationsShape.cpp (+107/-0) decorations/DecorationsShape.h (+54/-0) launcher/DeviceNotificationDisplay.h (+1/-1) launcher/DeviceNotificationDisplayImp.cpp (+4/-26) launcher/DeviceNotificationDisplayImp.h (+1/-1) launcher/FileManagerLauncherIcon.cpp (+4/-2) launcher/TrashLauncherIcon.cpp (+21/-17) launcher/VolumeLauncherIcon.cpp (+1/-1) lockscreen/LockScreenAcceleratorController.cpp (+12/-2) plugins/unityshell/src/unityshell.cpp (+2/-1) plugins/unityshell/unityshell.xml.in (+2/-0) tests/test_mock_devices.h (+1/-1) tests/test_unity_window_view.cpp (+6/-0) tests/test_volume_launcher_icon.cpp (+2/-2) tools/CMakeLists.txt (+22/-0) tools/unity.cmake (+6/-0) tools/unity_active_plugins_safety_check.cpp (+83/-0) unity-shared/CompizUtils.cpp (+3/-4) unity-shared/CompizUtils.h (+2/-1) unity-shared/PluginAdapter.cpp (+1/-1) unity-shared/TextInput.cpp (+4/-15) unity-shared/TextInput.h (+0/-1) unity-shared/UnityWindowView.cpp (+6/-1) unity7.conf.in (+3/-0) |
To merge this branch: | bzr merge lp:~unity-team/unity/x-sru3 |
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrea Azzarone (community) | Approve | ||
Review via email: mp+301625@code.launchpad.net |
Commit message
Releasing Unity Xenial SRU3.
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2016-05-14 23:01:37 +0000 | |||
3 | +++ CMakeLists.txt 2016-08-01 13:05:54 +0000 | |||
4 | @@ -425,3 +425,9 @@ | |||
5 | 425 | ADDITIONAL_MAKE_CLEAN_FILES api-doc) | 425 | ADDITIONAL_MAKE_CLEAN_FILES api-doc) |
6 | 426 | 426 | ||
7 | 427 | endif (DOXYGEN_FOUND STREQUAL "YES") | 427 | endif (DOXYGEN_FOUND STREQUAL "YES") |
8 | 428 | |||
9 | 429 | # | ||
10 | 430 | # Upstart | ||
11 | 431 | # | ||
12 | 432 | configure_file(unity7.conf.in ${CMAKE_CURRENT_BINARY_DIR}/unity7.conf) | ||
13 | 433 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unity7.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/sessions) | ||
14 | 428 | 434 | ||
15 | === modified file 'debian/changelog' | |||
16 | --- debian/changelog 2016-07-15 10:14:41 +0000 | |||
17 | +++ debian/changelog 2016-08-01 13:05:54 +0000 | |||
18 | @@ -1,3 +1,38 @@ | |||
19 | 1 | unity (7.4.0+16.04.20160715-0ubuntu2) UNRELEASED; urgency=medium | ||
20 | 2 | |||
21 | 3 | [ Andrea Azzarone ] | ||
22 | 4 | * FileManagerLauncherIcon: Don't trust the Quirk::VISIBLE in the ctor. | ||
23 | 5 | (LP: #1599133) | ||
24 | 6 | * [TrashLauncherIcon] Create GFileMonitor in an idle to avoid blocking | ||
25 | 7 | calls. (LP: #1602720) | ||
26 | 8 | * [LockSceen] Remove numlock warning. (LP: #1526322) | ||
27 | 9 | * Make sure initiate and terminate callbacks are not empty before | ||
28 | 10 | calling them. (LP: #1605012) | ||
29 | 11 | * Properly destroy close_button_ to properly disconnect lambda. (LP: | ||
30 | 12 | #1605010) | ||
31 | 13 | * Use the standard notification-device-eject in the "device eject" | ||
32 | 14 | notification. This allows us to scale it properly on high-dpi | ||
33 | 15 | setups. (LP: #1605231) | ||
34 | 16 | * Add tools to enforce unityshell plugin for the current profile and | ||
35 | 17 | add "move" and "resize" plugins as requirements. (LP: #1506023, LP: | ||
36 | 18 | #1605007, LP: #1604657) | ||
37 | 19 | |||
38 | 20 | [ Marco Trevisan (Treviño) ] | ||
39 | 21 | * Unity script: use result from unity_support_test to check the right | ||
40 | 22 | COMPIZ_CONFIG_PROFILE to use (LP: #1602377) | ||
41 | 23 | * LockScreenAcceleratorController: ensure callbacks are valid before | ||
42 | 24 | calling them (LP: #1605012) | ||
43 | 25 | |||
44 | 26 | [ Eleni Maria Stea ] | ||
45 | 27 | * DecoratedWindow: Added shadows for shaped windows (LP: 1608418) | ||
46 | 28 | |||
47 | 29 | [ Marco Trevisan (Treviño) ] | ||
48 | 30 | * DecoratedWindow: Cleanup shadows for shaped windows, reduce | ||
49 | 31 | recomputation (LP: #1608418) | ||
50 | 32 | * UnityWindowView: don't try to deference close_button_ if its' null | ||
51 | 33 | |||
52 | 34 | -- Andrea Azzarone <azzaronea@gmail.com> Mon, 01 Aug 2016 10:34:14 +0200 | ||
53 | 35 | |||
54 | 1 | unity (7.4.0+16.04.20160715-0ubuntu1) xenial; urgency=medium | 36 | unity (7.4.0+16.04.20160715-0ubuntu1) xenial; urgency=medium |
55 | 2 | 37 | ||
56 | 3 | [ Eleni Maria Stea ] | 38 | [ Eleni Maria Stea ] |
57 | 4 | 39 | ||
58 | === modified file 'debian/control' | |||
59 | --- debian/control 2016-03-21 15:38:17 +0000 | |||
60 | +++ debian/control 2016-08-01 13:05:54 +0000 | |||
61 | @@ -18,6 +18,7 @@ | |||
62 | 18 | libbamf3-dev (>= 0.5.3~bzr0), | 18 | libbamf3-dev (>= 0.5.3~bzr0), |
63 | 19 | libboost-dev, | 19 | libboost-dev, |
64 | 20 | libcairo2-dev, | 20 | libcairo2-dev, |
65 | 21 | libcompizconfig0-dev, | ||
66 | 21 | libdbus-1-dev, | 22 | libdbus-1-dev, |
67 | 22 | libdbusmenu-glib-dev (>= 0.3.91), | 23 | libdbusmenu-glib-dev (>= 0.3.91), |
68 | 23 | libdee-dev (>= 1.2.6), | 24 | libdee-dev (>= 1.2.6), |
69 | 24 | 25 | ||
70 | === modified file 'debian/libunity-core-6.0-9.install' | |||
71 | --- debian/libunity-core-6.0-9.install 2016-02-09 01:26:22 +0000 | |||
72 | +++ debian/libunity-core-6.0-9.install 2016-08-01 13:05:54 +0000 | |||
73 | @@ -3,7 +3,7 @@ | |||
74 | 3 | usr/share/ccsm | 3 | usr/share/ccsm |
75 | 4 | usr/share/gnome-control-center/ | 4 | usr/share/gnome-control-center/ |
76 | 5 | usr/share/unity | 5 | usr/share/unity |
77 | 6 | usr/share/upstart/sessions/unity7.conf | ||
78 | 6 | debian/unity-crashdb.conf etc/apport/crashdb.conf.d/ | 7 | debian/unity-crashdb.conf etc/apport/crashdb.conf.d/ |
79 | 7 | debian/source_unity.py usr/share/apport/package-hooks | 8 | debian/source_unity.py usr/share/apport/package-hooks |
80 | 8 | debian/unity7.conf usr/share/upstart/sessions | ||
81 | 9 | tools/convert-files/* usr/lib/compiz/migration/ | 9 | tools/convert-files/* usr/lib/compiz/migration/ |
82 | 10 | 10 | ||
83 | === modified file 'debian/unity-services.install' | |||
84 | --- debian/unity-services.install 2016-02-09 01:26:22 +0000 | |||
85 | +++ debian/unity-services.install 2016-08-01 13:05:54 +0000 | |||
86 | @@ -1,3 +1,3 @@ | |||
87 | 1 | usr/lib/*/unity/*service | 1 | usr/lib/*/unity/*service |
89 | 2 | usr/share/upstart | 2 | usr/share/upstart/sessions/unity-panel-service*.conf |
90 | 3 | usr/share/man/*/unity-panel-service.1 | 3 | usr/share/man/*/unity-panel-service.1 |
91 | 4 | 4 | ||
92 | === modified file 'debian/unity.install' | |||
93 | --- debian/unity.install 2016-02-09 01:26:22 +0000 | |||
94 | +++ debian/unity.install 2016-08-01 13:05:54 +0000 | |||
95 | @@ -1,6 +1,7 @@ | |||
96 | 1 | etc/pam.d | 1 | etc/pam.d |
97 | 2 | usr/bin | 2 | usr/bin |
98 | 3 | usr/lib/*/compiz/libunity*.so | 3 | usr/lib/*/compiz/libunity*.so |
99 | 4 | usr/lib/*/unity/unity-active-plugins-safety-check | ||
100 | 4 | usr/share/man/*/unity.1 | 5 | usr/share/man/*/unity.1 |
101 | 5 | usr/share/compiz | 6 | usr/share/compiz |
102 | 6 | usr/share/locale | 7 | usr/share/locale |
103 | 7 | 8 | ||
104 | === modified file 'decorations/CMakeLists.txt' | |||
105 | --- decorations/CMakeLists.txt 2014-03-27 19:32:34 +0000 | |||
106 | +++ decorations/CMakeLists.txt 2016-08-01 13:05:54 +0000 | |||
107 | @@ -35,6 +35,7 @@ | |||
108 | 35 | DecorationsMenuDropdown.cpp | 35 | DecorationsMenuDropdown.cpp |
109 | 36 | DecorationsForceQuitDialog.cpp | 36 | DecorationsForceQuitDialog.cpp |
110 | 37 | DecorationsDataPool.cpp | 37 | DecorationsDataPool.cpp |
111 | 38 | DecorationsShape.cpp | ||
112 | 38 | ) | 39 | ) |
113 | 39 | 40 | ||
114 | 40 | add_library (decorations-lib STATIC ${DECORATION_SOURCES}) | 41 | add_library (decorations-lib STATIC ${DECORATION_SOURCES}) |
115 | 41 | 42 | ||
116 | === modified file 'decorations/DecoratedWindow.cpp' | |||
117 | --- decorations/DecoratedWindow.cpp 2016-04-01 00:50:30 +0000 | |||
118 | +++ decorations/DecoratedWindow.cpp 2016-08-01 13:05:54 +0000 | |||
119 | @@ -38,6 +38,7 @@ | |||
120 | 38 | namespace | 38 | namespace |
121 | 39 | { | 39 | { |
122 | 40 | const std::string MENUS_PANEL_NAME = "WindowLIM"; | 40 | const std::string MENUS_PANEL_NAME = "WindowLIM"; |
123 | 41 | const int SHADOW_BLUR_MARGIN_FACTOR = 2; | ||
124 | 41 | } | 42 | } |
125 | 42 | 43 | ||
126 | 43 | Window::Impl::Impl(Window* parent, CompWindow* win) | 44 | Window::Impl::Impl(Window* parent, CompWindow* win) |
127 | @@ -492,6 +493,12 @@ | |||
128 | 492 | return deco_elements_ & cu::DecorationElement::SHADOW; | 493 | return deco_elements_ & cu::DecorationElement::SHADOW; |
129 | 493 | } | 494 | } |
130 | 494 | 495 | ||
131 | 496 | bool Window::Impl::ShapedShadowDecorated() const | ||
132 | 497 | { | ||
133 | 498 | return deco_elements_ & cu::DecorationElement::SHADOW && | ||
134 | 499 | deco_elements_ & cu::DecorationElement::SHAPED; | ||
135 | 500 | } | ||
136 | 501 | |||
137 | 495 | bool Window::Impl::FullyDecorated() const | 502 | bool Window::Impl::FullyDecorated() const |
138 | 496 | { | 503 | { |
139 | 497 | return deco_elements_ & cu::DecorationElement::BORDER; | 504 | return deco_elements_ & cu::DecorationElement::BORDER; |
140 | @@ -504,6 +511,14 @@ | |||
141 | 504 | 511 | ||
142 | 505 | GLTexture* Window::Impl::ShadowTexture() const | 512 | GLTexture* Window::Impl::ShadowTexture() const |
143 | 506 | { | 513 | { |
144 | 514 | if (shaped_shadow_pixmap_) | ||
145 | 515 | return shaped_shadow_pixmap_->texture(); | ||
146 | 516 | |||
147 | 517 | return SharedShadowTexture(); | ||
148 | 518 | } | ||
149 | 519 | |||
150 | 520 | GLTexture* Window::Impl::SharedShadowTexture() const | ||
151 | 521 | { | ||
152 | 507 | auto const& mi = manager_->impl_; | 522 | auto const& mi = manager_->impl_; |
153 | 508 | if (active() || parent_->scaled()) | 523 | if (active() || parent_->scaled()) |
154 | 509 | return mi->active_shadow_pixmap_->texture(); | 524 | return mi->active_shadow_pixmap_->texture(); |
155 | @@ -569,10 +584,22 @@ | |||
156 | 569 | if (!last_shadow_rect_.isEmpty()) | 584 | if (!last_shadow_rect_.isEmpty()) |
157 | 570 | last_shadow_rect_.setGeometry(0, 0, 0, 0); | 585 | last_shadow_rect_.setGeometry(0, 0, 0, 0); |
158 | 571 | 586 | ||
161 | 572 | return; | 587 | shaped_shadow_pixmap_.reset(); |
162 | 573 | } | 588 | } |
163 | 589 | else if (deco_elements_ & cu::DecorationElement::SHAPED) | ||
164 | 590 | { | ||
165 | 591 | ComputeShapedShadowQuad(); | ||
166 | 592 | } | ||
167 | 593 | else | ||
168 | 594 | { | ||
169 | 595 | shaped_shadow_pixmap_.reset(); | ||
170 | 596 | ComputeGenericShadowQuads(); | ||
171 | 597 | } | ||
172 | 598 | } | ||
173 | 574 | 599 | ||
175 | 575 | const auto* texture = ShadowTexture(); | 600 | void Window::Impl::ComputeGenericShadowQuads() |
176 | 601 | { | ||
177 | 602 | const auto* texture = SharedShadowTexture(); | ||
178 | 576 | 603 | ||
179 | 577 | if (!texture || !texture->width() || !texture->height()) | 604 | if (!texture || !texture->width() || !texture->height()) |
180 | 578 | return; | 605 | return; |
181 | @@ -676,6 +703,68 @@ | |||
182 | 676 | } | 703 | } |
183 | 677 | } | 704 | } |
184 | 678 | 705 | ||
185 | 706 | cu::PixmapTexture::Ptr Window::Impl::BuildShapedShadowTexture(nux::Size const& size, unsigned radius, nux::Color const& color, Shape const& shape) { | ||
186 | 707 | nux::CairoGraphics img(CAIRO_FORMAT_ARGB32, size.width, size.height); | ||
187 | 708 | auto* img_ctx = img.GetInternalContext(); | ||
188 | 709 | |||
189 | 710 | for (auto const& rect : shape.GetRectangles()) | ||
190 | 711 | { | ||
191 | 712 | cairo_rectangle(img_ctx, rect.x + radius * SHADOW_BLUR_MARGIN_FACTOR - shape.XOffset(), rect.y + radius * SHADOW_BLUR_MARGIN_FACTOR - shape.YOffset(), rect.width, rect.height); | ||
192 | 713 | cairo_set_source_rgba(img_ctx, color.red, color.green, color.blue, color.alpha); | ||
193 | 714 | cairo_fill(img_ctx); | ||
194 | 715 | } | ||
195 | 716 | |||
196 | 717 | img.BlurSurface(radius); | ||
197 | 718 | |||
198 | 719 | cu::CairoContext shadow_ctx(size.width, size.height); | ||
199 | 720 | cairo_set_source_surface(shadow_ctx, img.GetSurface(), 0, 0); | ||
200 | 721 | cairo_paint(shadow_ctx); | ||
201 | 722 | |||
202 | 723 | return shadow_ctx; | ||
203 | 724 | } | ||
204 | 725 | |||
205 | 726 | void Window::Impl::ComputeShapedShadowQuad() | ||
206 | 727 | { | ||
207 | 728 | nux::Color color = active() ? manager_->active_shadow_color() : manager_->inactive_shadow_color(); | ||
208 | 729 | unsigned int radius = active() ? manager_->active_shadow_radius() : manager_->inactive_shadow_radius(); | ||
209 | 730 | |||
210 | 731 | Shape shape(win_->id()); | ||
211 | 732 | auto const& border = win_->borderRect(); | ||
212 | 733 | auto const& shadow_offset = manager_->shadow_offset(); | ||
213 | 734 | |||
214 | 735 | // Ideally it would be shape.getWidth + radius * 2 but Cairographics::BlurSurface | ||
215 | 736 | // isn't bounded by the radius and we need to compensate by using a larger texture. | ||
216 | 737 | int width = shape.Width() + radius * 2 * SHADOW_BLUR_MARGIN_FACTOR; | ||
217 | 738 | int height = shape.Height() + radius * 2 * SHADOW_BLUR_MARGIN_FACTOR; | ||
218 | 739 | |||
219 | 740 | if (width != last_shadow_rect_.width() || height != last_shadow_rect_.height()) | ||
220 | 741 | shaped_shadow_pixmap_ = BuildShapedShadowTexture({width, height}, radius, color, shape); | ||
221 | 742 | |||
222 | 743 | const auto* texture = shaped_shadow_pixmap_->texture(); | ||
223 | 744 | |||
224 | 745 | if (!texture || !texture->width() || !texture->height()) | ||
225 | 746 | return; | ||
226 | 747 | |||
227 | 748 | int x = border.x() + shadow_offset.x - radius * 2 + shape.XOffset(); | ||
228 | 749 | int y = border.y() + shadow_offset.y - radius * 2 + shape.YOffset(); | ||
229 | 750 | |||
230 | 751 | auto* quad = &shadow_quads_[Quads::Pos(0)]; | ||
231 | 752 | quad->box.setGeometry(x, y, width, height); | ||
232 | 753 | quad->matrix = texture->matrix(); | ||
233 | 754 | quad->matrix.x0 = -COMP_TEX_COORD_X(quad->matrix, quad->box.x1()); | ||
234 | 755 | quad->matrix.y0 = -COMP_TEX_COORD_Y(quad->matrix, quad->box.y1()); | ||
235 | 756 | |||
236 | 757 | CompRect shaped_shadow_rect(x, y, width, height); | ||
237 | 758 | if (shaped_shadow_rect != last_shadow_rect_) | ||
238 | 759 | { | ||
239 | 760 | auto const& win_region = win_->region(); | ||
240 | 761 | quad->region = CompRegion(quad->box) - win_region; | ||
241 | 762 | |||
242 | 763 | last_shadow_rect_ = shaped_shadow_rect; | ||
243 | 764 | win_->updateWindowOutputExtents(); | ||
244 | 765 | } | ||
245 | 766 | } | ||
246 | 767 | |||
247 | 679 | void Window::Impl::Paint(GLMatrix const& transformation, | 768 | void Window::Impl::Paint(GLMatrix const& transformation, |
248 | 680 | GLWindowPaintAttrib const& attrib, | 769 | GLWindowPaintAttrib const& attrib, |
249 | 681 | CompRegion const& region, unsigned mask) | 770 | CompRegion const& region, unsigned mask) |
250 | @@ -714,14 +803,18 @@ | |||
251 | 714 | 803 | ||
252 | 715 | glwin_->vertexBuffer()->begin(); | 804 | glwin_->vertexBuffer()->begin(); |
253 | 716 | 805 | ||
255 | 717 | for (unsigned i = 0; i < shadow_quads_.size(); ++i) | 806 | unsigned int num_quads = ShapedShadowDecorated() ? 1 : shadow_quads_.size(); |
256 | 807 | for (unsigned int i = 0; i < num_quads; ++i) | ||
257 | 718 | { | 808 | { |
258 | 719 | auto& quad = shadow_quads_[Quads::Pos(i)]; | 809 | auto& quad = shadow_quads_[Quads::Pos(i)]; |
259 | 720 | glwin_->glAddGeometry(quad.matrices, quad.region, clip_region); | 810 | glwin_->glAddGeometry(quad.matrices, quad.region, clip_region); |
260 | 721 | } | 811 | } |
261 | 722 | 812 | ||
262 | 723 | if (glwin_->vertexBuffer()->end()) | 813 | if (glwin_->vertexBuffer()->end()) |
264 | 724 | glwin_->glDrawTexture(ShadowTexture(), transformation, attrib, mask); | 814 | { |
265 | 815 | if (GLTexture* texture = ShadowTexture()) | ||
266 | 816 | glwin_->glDrawTexture(texture, transformation, attrib, mask); | ||
267 | 817 | } | ||
268 | 725 | 818 | ||
269 | 726 | for (auto const& dtex : bg_textures_) | 819 | for (auto const& dtex : bg_textures_) |
270 | 727 | { | 820 | { |
271 | @@ -746,6 +839,9 @@ | |||
272 | 746 | 839 | ||
273 | 747 | void Window::Impl::RedrawDecorations() | 840 | void Window::Impl::RedrawDecorations() |
274 | 748 | { | 841 | { |
275 | 842 | if (!win_->isMapped()) | ||
276 | 843 | return; | ||
277 | 844 | |||
278 | 749 | dirty_geo_ = true; | 845 | dirty_geo_ = true; |
279 | 750 | cwin_->damageOutputExtents(); | 846 | cwin_->damageOutputExtents(); |
280 | 751 | } | 847 | } |
281 | 752 | 848 | ||
282 | === modified file 'decorations/DecoratedWindow.h' | |||
283 | --- decorations/DecoratedWindow.h 2015-08-07 18:54:07 +0000 | |||
284 | +++ decorations/DecoratedWindow.h 2016-08-01 13:05:54 +0000 | |||
285 | @@ -21,6 +21,7 @@ | |||
286 | 21 | #define UNITY_DECORATED_WINDOW | 21 | #define UNITY_DECORATED_WINDOW |
287 | 22 | 22 | ||
288 | 23 | #include "Introspectable.h" | 23 | #include "Introspectable.h" |
289 | 24 | #include <NuxCore/Property.h> | ||
290 | 24 | #include <memory> | 25 | #include <memory> |
291 | 25 | 26 | ||
292 | 26 | class CompRegion; | 27 | class CompRegion; |
293 | 27 | 28 | ||
294 | === modified file 'decorations/DecorationsManager.cpp' | |||
295 | --- decorations/DecorationsManager.cpp 2016-03-09 17:28:36 +0000 | |||
296 | +++ decorations/DecorationsManager.cpp 2016-08-01 13:05:54 +0000 | |||
297 | @@ -20,9 +20,9 @@ | |||
298 | 20 | #include "DecorationsPriv.h" | 20 | #include "DecorationsPriv.h" |
299 | 21 | 21 | ||
300 | 22 | #include <core/atoms.h> | 22 | #include <core/atoms.h> |
301 | 23 | #include <NuxGraphics/CairoGraphics.h> | ||
302 | 24 | #include <UnityCore/DBusIndicators.h> | 23 | #include <UnityCore/DBusIndicators.h> |
303 | 25 | #include <X11/Xatom.h> | 24 | #include <X11/Xatom.h> |
304 | 25 | |||
305 | 26 | #include "WindowManager.h" | 26 | #include "WindowManager.h" |
306 | 27 | 27 | ||
307 | 28 | namespace unity | 28 | namespace unity |
308 | 29 | 29 | ||
309 | === modified file 'decorations/DecorationsPriv.h' | |||
310 | --- decorations/DecorationsPriv.h 2016-04-01 00:50:30 +0000 | |||
311 | +++ decorations/DecorationsPriv.h 2016-08-01 13:05:54 +0000 | |||
312 | @@ -23,6 +23,7 @@ | |||
313 | 23 | #include <unordered_map> | 23 | #include <unordered_map> |
314 | 24 | #include <NuxCore/NuxCore.h> | 24 | #include <NuxCore/NuxCore.h> |
315 | 25 | #include <NuxCore/Rect.h> | 25 | #include <NuxCore/Rect.h> |
316 | 26 | #include <NuxGraphics/CairoGraphics.h> | ||
317 | 26 | #include <UnityCore/ConnectionManager.h> | 27 | #include <UnityCore/ConnectionManager.h> |
318 | 27 | #include <UnityCore/Indicators.h> | 28 | #include <UnityCore/Indicators.h> |
319 | 28 | #include <core/core.h> | 29 | #include <core/core.h> |
320 | @@ -30,6 +31,7 @@ | |||
321 | 30 | #include <composite/composite.h> | 31 | #include <composite/composite.h> |
322 | 31 | #include <X11/extensions/shape.h> | 32 | #include <X11/extensions/shape.h> |
323 | 32 | 33 | ||
324 | 34 | #include "DecorationsShape.h" | ||
325 | 33 | #include "DecorationsDataPool.h" | 35 | #include "DecorationsDataPool.h" |
326 | 34 | #include "DecorationsManager.h" | 36 | #include "DecorationsManager.h" |
327 | 35 | #include "DecorationsInputMixer.h" | 37 | #include "DecorationsInputMixer.h" |
328 | @@ -88,6 +90,7 @@ | |||
329 | 88 | bool IsMaximized() const; | 90 | bool IsMaximized() const; |
330 | 89 | bool FullyDecorated() const; | 91 | bool FullyDecorated() const; |
331 | 90 | bool ShadowDecorated() const; | 92 | bool ShadowDecorated() const; |
332 | 93 | bool ShapedShadowDecorated() const; | ||
333 | 91 | void RedrawDecorations(); | 94 | void RedrawDecorations(); |
334 | 92 | void Damage(); | 95 | void Damage(); |
335 | 93 | void SetupAppMenu(); | 96 | void SetupAppMenu(); |
336 | @@ -117,14 +120,18 @@ | |||
337 | 117 | void SyncMenusGeometries() const; | 120 | void SyncMenusGeometries() const; |
338 | 118 | bool ShouldBeDecorated() const; | 121 | bool ShouldBeDecorated() const; |
339 | 119 | GLTexture* ShadowTexture() const; | 122 | GLTexture* ShadowTexture() const; |
340 | 123 | GLTexture* SharedShadowTexture() const; | ||
341 | 120 | unsigned ShadowRadius() const; | 124 | unsigned ShadowRadius() const; |
342 | 121 | std::string const& GetMenusPanelID() const; | 125 | std::string const& GetMenusPanelID() const; |
343 | 122 | 126 | ||
344 | 123 | void ComputeShadowQuads(); | 127 | void ComputeShadowQuads(); |
345 | 128 | void ComputeGenericShadowQuads(); | ||
346 | 129 | void ComputeShapedShadowQuad(); | ||
347 | 124 | void UpdateDecorationTextures(); | 130 | void UpdateDecorationTextures(); |
348 | 125 | void UpdateWindowEdgesGeo(); | 131 | void UpdateWindowEdgesGeo(); |
349 | 126 | void UpdateForceQuitDialogPosition(); | 132 | void UpdateForceQuitDialogPosition(); |
350 | 127 | void RenderDecorationTexture(Side, nux::Geometry const&); | 133 | void RenderDecorationTexture(Side, nux::Geometry const&); |
351 | 134 | cu::PixmapTexture::Ptr BuildShapedShadowTexture(nux::Size const&, unsigned radius, nux::Color const&, Shape const&); | ||
352 | 128 | void Paint(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask); | 135 | void Paint(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask); |
353 | 129 | void Draw(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask); | 136 | void Draw(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask); |
354 | 130 | 137 | ||
355 | @@ -155,6 +162,7 @@ | |||
356 | 155 | std::string last_title_; | 162 | std::string last_title_; |
357 | 156 | std::string panel_id_; | 163 | std::string panel_id_; |
358 | 157 | std::vector<cu::SimpleTextureQuad> bg_textures_; | 164 | std::vector<cu::SimpleTextureQuad> bg_textures_; |
359 | 165 | cu::PixmapTexture::Ptr shaped_shadow_pixmap_; | ||
360 | 158 | std::shared_ptr<ForceQuitDialog> force_quit_; | 166 | std::shared_ptr<ForceQuitDialog> force_quit_; |
361 | 159 | InputMixer::Ptr input_mixer_; | 167 | InputMixer::Ptr input_mixer_; |
362 | 160 | Layout::Ptr top_layout_; | 168 | Layout::Ptr top_layout_; |
363 | 161 | 169 | ||
364 | === added file 'decorations/DecorationsShape.cpp' | |||
365 | --- decorations/DecorationsShape.cpp 1970-01-01 00:00:00 +0000 | |||
366 | +++ decorations/DecorationsShape.cpp 2016-08-01 13:05:54 +0000 | |||
367 | @@ -0,0 +1,107 @@ | |||
368 | 1 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- | ||
369 | 2 | /* | ||
370 | 3 | * Copyright (C) 2016 Canonical Ltd | ||
371 | 4 | * | ||
372 | 5 | * This program is free software: you can redistribute it and/or modify | ||
373 | 6 | * it under the terms of the GNU General Public License version 3 as | ||
374 | 7 | * published by the Free Software Foundation. | ||
375 | 8 | * | ||
376 | 9 | * This program is distributed in the hope that it will be useful, | ||
377 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
378 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
379 | 12 | * GNU General Public License for more details. | ||
380 | 13 | * | ||
381 | 14 | * You should have received a copy of the GNU General Public License | ||
382 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
383 | 16 | * | ||
384 | 17 | * Authored by: Eleni Maria Stea <elenimaria.stea@canonical.com> | ||
385 | 18 | */ | ||
386 | 19 | |||
387 | 20 | #include "DecorationsShape.h" | ||
388 | 21 | |||
389 | 22 | #include <core/core.h> | ||
390 | 23 | #include <NuxCore/Logger.h> | ||
391 | 24 | #include <X11/extensions/shape.h> | ||
392 | 25 | |||
393 | 26 | namespace unity | ||
394 | 27 | { | ||
395 | 28 | namespace decoration | ||
396 | 29 | { | ||
397 | 30 | namespace | ||
398 | 31 | { | ||
399 | 32 | DECLARE_LOGGER(logger, "unity.decoration.shape"); | ||
400 | 33 | } | ||
401 | 34 | |||
402 | 35 | Shape::Shape(Window xid) | ||
403 | 36 | { | ||
404 | 37 | Bool buse, cuse; | ||
405 | 38 | int bx, by, cx, cy; | ||
406 | 39 | unsigned int bw, bh, cw, ch; | ||
407 | 40 | Display *dpy = screen->dpy(); | ||
408 | 41 | |||
409 | 42 | XShapeQueryExtents(dpy, xid, &buse, &bx, &by, &bw, &bh, &cuse, &cx, &cy, &cw, &ch); | ||
410 | 43 | |||
411 | 44 | int kind; | ||
412 | 45 | |||
413 | 46 | if (buse) | ||
414 | 47 | { | ||
415 | 48 | width_ = bw; | ||
416 | 49 | height_ = bh; | ||
417 | 50 | xoffs_ = bx; | ||
418 | 51 | yoffs_ = by; | ||
419 | 52 | kind = ShapeBounding; | ||
420 | 53 | } | ||
421 | 54 | else if (cuse) | ||
422 | 55 | { | ||
423 | 56 | width_ = cw; | ||
424 | 57 | height_ = ch; | ||
425 | 58 | xoffs_ = cx; | ||
426 | 59 | yoffs_ = cy; | ||
427 | 60 | kind = ShapeClip; | ||
428 | 61 | } | ||
429 | 62 | else | ||
430 | 63 | { | ||
431 | 64 | LOG_ERROR(logger) << "XShapeQueryExtend returned no extents"; | ||
432 | 65 | return; | ||
433 | 66 | } | ||
434 | 67 | |||
435 | 68 | int rect_count, rect_order; | ||
436 | 69 | std::unique_ptr<XRectangle[], int(*)(void*)> rectangles(XShapeGetRectangles(dpy, xid, kind, &rect_count, &rect_order), XFree); | ||
437 | 70 | |||
438 | 71 | if (!rectangles) | ||
439 | 72 | { | ||
440 | 73 | LOG_ERROR(logger) << "Failed to get shape rectangles"; | ||
441 | 74 | return; | ||
442 | 75 | } | ||
443 | 76 | |||
444 | 77 | for (int i = 0; i < rect_count; ++i) | ||
445 | 78 | rectangles_.push_back(rectangles[i]); | ||
446 | 79 | } | ||
447 | 80 | |||
448 | 81 | std::vector<XRectangle> const& Shape::GetRectangles() const | ||
449 | 82 | { | ||
450 | 83 | return rectangles_; | ||
451 | 84 | } | ||
452 | 85 | |||
453 | 86 | int Shape::Width() const | ||
454 | 87 | { | ||
455 | 88 | return width_; | ||
456 | 89 | } | ||
457 | 90 | |||
458 | 91 | int Shape::Height() const | ||
459 | 92 | { | ||
460 | 93 | return height_; | ||
461 | 94 | } | ||
462 | 95 | |||
463 | 96 | int Shape::XOffset() const | ||
464 | 97 | { | ||
465 | 98 | return xoffs_; | ||
466 | 99 | } | ||
467 | 100 | |||
468 | 101 | int Shape::YOffset() const | ||
469 | 102 | { | ||
470 | 103 | return yoffs_; | ||
471 | 104 | } | ||
472 | 105 | |||
473 | 106 | } // decoration namespace | ||
474 | 107 | } // unity namespace | ||
475 | 0 | 108 | ||
476 | === added file 'decorations/DecorationsShape.h' | |||
477 | --- decorations/DecorationsShape.h 1970-01-01 00:00:00 +0000 | |||
478 | +++ decorations/DecorationsShape.h 2016-08-01 13:05:54 +0000 | |||
479 | @@ -0,0 +1,54 @@ | |||
480 | 1 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- | ||
481 | 2 | /* | ||
482 | 3 | * Copyright (C) 2016 Canonical Ltd | ||
483 | 4 | * | ||
484 | 5 | * This program is free software: you can redistribute it and/or modify | ||
485 | 6 | * it under the terms of the GNU General Public License version 3 as | ||
486 | 7 | * published by the Free Software Foundation. | ||
487 | 8 | * | ||
488 | 9 | * This program is distributed in the hope that it will be useful, | ||
489 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
490 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
491 | 12 | * GNU General Public License for more details. | ||
492 | 13 | * | ||
493 | 14 | * You should have received a copy of the GNU General Public License | ||
494 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
495 | 16 | * | ||
496 | 17 | * Authored by: Eleni Maria Stea <elenimaria.stea@canonical.com> | ||
497 | 18 | */ | ||
498 | 19 | |||
499 | 20 | #ifndef DECORATIONS_SHAPE_H_ | ||
500 | 21 | #define DECORATIONS_SHAPE_H_ | ||
501 | 22 | |||
502 | 23 | #include <X11/Xlib.h> | ||
503 | 24 | #include <vector> | ||
504 | 25 | |||
505 | 26 | namespace unity | ||
506 | 27 | { | ||
507 | 28 | namespace decoration | ||
508 | 29 | { | ||
509 | 30 | class Shape | ||
510 | 31 | { | ||
511 | 32 | public: | ||
512 | 33 | Shape(Window); | ||
513 | 34 | |||
514 | 35 | int Width() const; | ||
515 | 36 | int Height() const; | ||
516 | 37 | int XOffset() const; | ||
517 | 38 | int YOffset() const; | ||
518 | 39 | |||
519 | 40 | std::vector<XRectangle> const& GetRectangles() const; | ||
520 | 41 | |||
521 | 42 | private: | ||
522 | 43 | int width_; | ||
523 | 44 | int height_; | ||
524 | 45 | int xoffs_; | ||
525 | 46 | int yoffs_; | ||
526 | 47 | |||
527 | 48 | std::vector<XRectangle> rectangles_; | ||
528 | 49 | }; | ||
529 | 50 | |||
530 | 51 | } // decoration namespace | ||
531 | 52 | } // unity namespace | ||
532 | 53 | |||
533 | 54 | #endif //DECORATIONS_SHAPE_H_ | ||
534 | 0 | 55 | ||
535 | === modified file 'launcher/DeviceNotificationDisplay.h' | |||
536 | --- launcher/DeviceNotificationDisplay.h 2012-08-22 09:03:25 +0000 | |||
537 | +++ launcher/DeviceNotificationDisplay.h 2016-08-01 13:05:54 +0000 | |||
538 | @@ -36,7 +36,7 @@ | |||
539 | 36 | 36 | ||
540 | 37 | virtual ~DeviceNotificationDisplay() {} | 37 | virtual ~DeviceNotificationDisplay() {} |
541 | 38 | 38 | ||
543 | 39 | virtual void Display(std::string const& icon_name, std::string const& volume_name) = 0; | 39 | virtual void Display(std::string const& volume_name) = 0; |
544 | 40 | }; | 40 | }; |
545 | 41 | 41 | ||
546 | 42 | } | 42 | } |
547 | 43 | 43 | ||
548 | === modified file 'launcher/DeviceNotificationDisplayImp.cpp' | |||
549 | --- launcher/DeviceNotificationDisplayImp.cpp 2015-04-22 23:54:26 +0000 | |||
550 | +++ launcher/DeviceNotificationDisplayImp.cpp 2016-08-01 13:05:54 +0000 | |||
551 | @@ -20,49 +20,27 @@ | |||
552 | 20 | #include "config.h" | 20 | #include "config.h" |
553 | 21 | #include <glib/gi18n-lib.h> | 21 | #include <glib/gi18n-lib.h> |
554 | 22 | #include <libnotify/notify.h> | 22 | #include <libnotify/notify.h> |
555 | 23 | #include <sigc++/sigc++.h> | ||
556 | 24 | #include <UnityCore/GLibWrapper.h> | 23 | #include <UnityCore/GLibWrapper.h> |
557 | 25 | 24 | ||
558 | 26 | #include "DeviceNotificationDisplayImp.h" | 25 | #include "DeviceNotificationDisplayImp.h" |
559 | 27 | #include "unity-shared/IconLoader.h" | ||
560 | 28 | 26 | ||
561 | 29 | namespace unity | 27 | namespace unity |
562 | 30 | { | 28 | { |
563 | 31 | namespace launcher | 29 | namespace launcher |
564 | 32 | { | 30 | { |
565 | 33 | 31 | ||
566 | 34 | namespace | ||
567 | 35 | { | ||
568 | 36 | const unsigned icon_size = 48; | ||
569 | 37 | } | ||
570 | 38 | |||
571 | 39 | // | 32 | // |
572 | 40 | // Start private implementation | 33 | // Start private implementation |
573 | 41 | // | 34 | // |
574 | 42 | class DeviceNotificationDisplayImp::Impl | 35 | class DeviceNotificationDisplayImp::Impl |
575 | 43 | { | 36 | { |
576 | 44 | public: | 37 | public: |
588 | 45 | void Show(std::string const& icon_name, std::string const& volume_name) | 38 | void Show(std::string const& volume_name) |
578 | 46 | { | ||
579 | 47 | IconLoader::GetDefault().LoadFromGIconString(icon_name, -1, icon_size, | ||
580 | 48 | sigc::bind(sigc::mem_fun(this, &Impl::ShowNotificationWhenIconIsReady), volume_name)); | ||
581 | 49 | } | ||
582 | 50 | |||
583 | 51 | void ShowNotificationWhenIconIsReady(std::string const& icon_name, | ||
584 | 52 | int max_width, | ||
585 | 53 | int max_height, | ||
586 | 54 | glib::Object<GdkPixbuf> const& pixbuf, | ||
587 | 55 | std::string const& volume_name) | ||
589 | 56 | { | 39 | { |
590 | 57 | glib::Object<NotifyNotification> notification(notify_notification_new(volume_name.c_str(), | 40 | glib::Object<NotifyNotification> notification(notify_notification_new(volume_name.c_str(), |
591 | 58 | _("The drive has been successfully ejected"), | 41 | _("The drive has been successfully ejected"), |
594 | 59 | nullptr)); | 42 | "notification-device-eject")); |
593 | 60 | |||
595 | 61 | notify_notification_set_hint(notification, "x-canonical-private-synchronous", g_variant_new_boolean(TRUE)); | 43 | notify_notification_set_hint(notification, "x-canonical-private-synchronous", g_variant_new_boolean(TRUE)); |
596 | 62 | |||
597 | 63 | if (pixbuf) | ||
598 | 64 | notify_notification_set_image_from_pixbuf(notification, pixbuf); | ||
599 | 65 | |||
600 | 66 | notify_notification_show(notification, nullptr); | 44 | notify_notification_show(notification, nullptr); |
601 | 67 | } | 45 | } |
602 | 68 | }; | 46 | }; |
603 | @@ -78,9 +56,9 @@ | |||
604 | 78 | DeviceNotificationDisplayImp::~DeviceNotificationDisplayImp() | 56 | DeviceNotificationDisplayImp::~DeviceNotificationDisplayImp() |
605 | 79 | {} | 57 | {} |
606 | 80 | 58 | ||
608 | 81 | void DeviceNotificationDisplayImp::Display(std::string const& icon_name, std::string const& volume_name) | 59 | void DeviceNotificationDisplayImp::Display(std::string const& volume_name) |
609 | 82 | { | 60 | { |
611 | 83 | pimpl->Show(icon_name, volume_name); | 61 | pimpl->Show(volume_name); |
612 | 84 | } | 62 | } |
613 | 85 | 63 | ||
614 | 86 | } | 64 | } |
615 | 87 | 65 | ||
616 | === modified file 'launcher/DeviceNotificationDisplayImp.h' | |||
617 | --- launcher/DeviceNotificationDisplayImp.h 2012-08-22 09:03:25 +0000 | |||
618 | +++ launcher/DeviceNotificationDisplayImp.h 2016-08-01 13:05:54 +0000 | |||
619 | @@ -33,7 +33,7 @@ | |||
620 | 33 | DeviceNotificationDisplayImp(); | 33 | DeviceNotificationDisplayImp(); |
621 | 34 | virtual ~DeviceNotificationDisplayImp(); | 34 | virtual ~DeviceNotificationDisplayImp(); |
622 | 35 | 35 | ||
624 | 36 | virtual void Display(std::string const& icon_name, std::string const& volume_name); | 36 | virtual void Display(std::string const& volume_name); |
625 | 37 | 37 | ||
626 | 38 | private: | 38 | private: |
627 | 39 | class Impl; | 39 | class Impl; |
628 | 40 | 40 | ||
629 | === modified file 'launcher/FileManagerLauncherIcon.cpp' | |||
630 | --- launcher/FileManagerLauncherIcon.cpp 2016-07-05 10:21:45 +0000 | |||
631 | +++ launcher/FileManagerLauncherIcon.cpp 2016-08-01 13:05:54 +0000 | |||
632 | @@ -46,6 +46,9 @@ | |||
633 | 46 | // We disconnect from ApplicationLauncherIcon app signals, as we manage them manually | 46 | // We disconnect from ApplicationLauncherIcon app signals, as we manage them manually |
634 | 47 | signals_conn_.Clear(); | 47 | signals_conn_.Clear(); |
635 | 48 | 48 | ||
636 | 49 | SetQuirk(Quirk::VISIBLE, false); | ||
637 | 50 | SkipQuirkAnimation(Quirk::VISIBLE); | ||
638 | 51 | |||
639 | 49 | signals_conn_.Add(app_->desktop_file.changed.connect([this](std::string const& desktop_file) { | 52 | signals_conn_.Add(app_->desktop_file.changed.connect([this](std::string const& desktop_file) { |
640 | 50 | LOG_DEBUG(logger) << tooltip_text() << " desktop_file now " << desktop_file; | 53 | LOG_DEBUG(logger) << tooltip_text() << " desktop_file now " << desktop_file; |
641 | 51 | UpdateDesktopFile(); | 54 | UpdateDesktopFile(); |
642 | @@ -74,7 +77,6 @@ | |||
643 | 74 | _source_manager.Remove(ICON_REMOVE_TIMEOUT); | 77 | _source_manager.Remove(ICON_REMOVE_TIMEOUT); |
644 | 75 | })); | 78 | })); |
645 | 76 | 79 | ||
646 | 77 | |||
647 | 78 | UpdateStorageWindows(); | 80 | UpdateStorageWindows(); |
648 | 79 | } | 81 | } |
649 | 80 | 82 | ||
650 | @@ -120,7 +122,7 @@ | |||
651 | 120 | 122 | ||
652 | 121 | for (auto const& app_win : ApplicationLauncherIcon::GetManagedWindows()) | 123 | for (auto const& app_win : ApplicationLauncherIcon::GetManagedWindows()) |
653 | 122 | { | 124 | { |
655 | 123 | if (IsLocationManaged(file_manager_->LocationForWindow(app_win))) | 125 | if (WindowManager::Default().IsWindowMapped(app_win->window_id()) && IsLocationManaged(file_manager_->LocationForWindow(app_win))) |
656 | 124 | fm_windows.push_back(app_win); | 126 | fm_windows.push_back(app_win); |
657 | 125 | } | 127 | } |
658 | 126 | 128 | ||
659 | 127 | 129 | ||
660 | === modified file 'launcher/TrashLauncherIcon.cpp' | |||
661 | --- launcher/TrashLauncherIcon.cpp 2015-12-11 15:15:47 +0000 | |||
662 | +++ launcher/TrashLauncherIcon.cpp 2016-08-01 13:05:54 +0000 | |||
663 | @@ -55,23 +55,27 @@ | |||
664 | 55 | SkipQuirkAnimation(Quirk::VISIBLE); | 55 | SkipQuirkAnimation(Quirk::VISIBLE); |
665 | 56 | SetShortcut('t'); | 56 | SetShortcut('t'); |
666 | 57 | 57 | ||
684 | 58 | glib::Object<GFile> location(g_file_new_for_uri(TRASH_URI.c_str())); | 58 | _source_manager.AddIdle([this]{ |
685 | 59 | 59 | glib::Object<GFile> location(g_file_new_for_uri(TRASH_URI.c_str())); | |
686 | 60 | glib::Error err; | 60 | |
687 | 61 | trash_monitor_ = g_file_monitor_directory(location, G_FILE_MONITOR_NONE, cancellable_, &err); | 61 | glib::Error err; |
688 | 62 | g_file_monitor_set_rate_limit(trash_monitor_, 1000); | 62 | trash_monitor_ = g_file_monitor_directory(location, G_FILE_MONITOR_NONE, cancellable_, &err); |
689 | 63 | 63 | g_file_monitor_set_rate_limit(trash_monitor_, 1000); | |
690 | 64 | if (err) | 64 | |
691 | 65 | { | 65 | if (err) |
692 | 66 | LOG_ERROR(logger) << "Could not create file monitor for trash uri: " << err; | 66 | { |
693 | 67 | } | 67 | LOG_ERROR(logger) << "Could not create file monitor for trash uri: " << err; |
694 | 68 | else | 68 | } |
695 | 69 | { | 69 | else |
696 | 70 | glib_signals_.Add<void, GFileMonitor*, GFile*, GFile*, GFileMonitorEvent>(trash_monitor_, "changed", | 70 | { |
697 | 71 | [this] (GFileMonitor*, GFile*, GFile*, GFileMonitorEvent) { | 71 | glib_signals_.Add<void, GFileMonitor*, GFile*, GFile*, GFileMonitorEvent>(trash_monitor_, "changed", |
698 | 72 | UpdateTrashIcon(); | 72 | [this] (GFileMonitor*, GFile*, GFile*, GFileMonitorEvent) { |
699 | 73 | }); | 73 | UpdateTrashIcon(); |
700 | 74 | } | 74 | }); |
701 | 75 | } | ||
702 | 76 | |||
703 | 77 | return false; | ||
704 | 78 | }); | ||
705 | 75 | 79 | ||
706 | 76 | UpdateTrashIcon(); | 80 | UpdateTrashIcon(); |
707 | 77 | UpdateStorageWindows(); | 81 | UpdateStorageWindows(); |
708 | 78 | 82 | ||
709 | === modified file 'launcher/VolumeLauncherIcon.cpp' | |||
710 | --- launcher/VolumeLauncherIcon.cpp 2016-02-25 13:42:10 +0000 | |||
711 | +++ launcher/VolumeLauncherIcon.cpp 2016-08-01 13:05:54 +0000 | |||
712 | @@ -108,7 +108,7 @@ | |||
713 | 108 | 108 | ||
714 | 109 | auto conn = std::make_shared<sigc::connection>(); | 109 | auto conn = std::make_shared<sigc::connection>(); |
715 | 110 | *conn = volume_->ejected.connect([this, conn] { | 110 | *conn = volume_->ejected.connect([this, conn] { |
717 | 111 | notification_->Display(volume_->GetIconName(), volume_->GetName()); | 111 | notification_->Display(volume_->GetName()); |
718 | 112 | conn->disconnect(); | 112 | conn->disconnect(); |
719 | 113 | }); | 113 | }); |
720 | 114 | connections_.Add(*conn); | 114 | connections_.Add(*conn); |
721 | 115 | 115 | ||
722 | === modified file 'lockscreen/LockScreenAcceleratorController.cpp' | |||
723 | --- lockscreen/LockScreenAcceleratorController.cpp 2016-07-05 10:22:08 +0000 | |||
724 | +++ lockscreen/LockScreenAcceleratorController.cpp 2016-08-01 13:05:54 +0000 | |||
725 | @@ -194,10 +194,20 @@ | |||
726 | 194 | CompOption::Vector options; | 194 | CompOption::Vector options; |
727 | 195 | 195 | ||
728 | 196 | if (action.state() & CompAction::StateInitKey) | 196 | if (action.state() & CompAction::StateInitKey) |
730 | 197 | action.initiate()(&action, 0, options); | 197 | { |
731 | 198 | auto const& initiate_cb = action.initiate(); | ||
732 | 199 | |||
733 | 200 | if (!initiate_cb.empty()) | ||
734 | 201 | initiate_cb(&action, 0, options); | ||
735 | 202 | } | ||
736 | 198 | 203 | ||
737 | 199 | if (action.state() & CompAction::StateTermKey) | 204 | if (action.state() & CompAction::StateTermKey) |
739 | 200 | action.terminate()(&action, CompAction::StateTermTapped, options); | 205 | { |
740 | 206 | auto const& terminate_cb = action.terminate(); | ||
741 | 207 | |||
742 | 208 | if (!terminate_cb.empty()) | ||
743 | 209 | terminate_cb(&action, CompAction::StateTermTapped, options); | ||
744 | 210 | } | ||
745 | 201 | } | 211 | } |
746 | 202 | 212 | ||
747 | 203 | Accelerators::Ptr const& AcceleratorController::GetAccelerators() const | 213 | Accelerators::Ptr const& AcceleratorController::GetAccelerators() const |
748 | 204 | 214 | ||
749 | === modified file 'plugins/unityshell/src/unityshell.cpp' | |||
750 | --- plugins/unityshell/src/unityshell.cpp 2016-07-05 10:22:42 +0000 | |||
751 | +++ plugins/unityshell/src/unityshell.cpp 2016-08-01 13:05:54 +0000 | |||
752 | @@ -3013,9 +3013,9 @@ | |||
753 | 3013 | wAttrib.opacity = 0.0; | 3013 | wAttrib.opacity = 0.0; |
754 | 3014 | int old_index = gWindow->glPaintGetCurrentIndex(); | 3014 | int old_index = gWindow->glPaintGetCurrentIndex(); |
755 | 3015 | gWindow->glPaintSetCurrentIndex(MAXSHORT); | 3015 | gWindow->glPaintSetCurrentIndex(MAXSHORT); |
756 | 3016 | deco_win_->Paint(matrix, wAttrib, region, mask); | ||
757 | 3016 | bool ret = gWindow->glPaint(wAttrib, matrix, region, mask); | 3017 | bool ret = gWindow->glPaint(wAttrib, matrix, region, mask); |
758 | 3017 | gWindow->glPaintSetCurrentIndex(old_index); | 3018 | gWindow->glPaintSetCurrentIndex(old_index); |
759 | 3018 | deco_win_->Paint(matrix, wAttrib, region, mask); | ||
760 | 3019 | return ret; | 3019 | return ret; |
761 | 3020 | } | 3020 | } |
762 | 3021 | } | 3021 | } |
763 | @@ -3357,6 +3357,7 @@ | |||
764 | 3357 | PluginAdapter::Default().UpdateShowDesktopState(); | 3357 | PluginAdapter::Default().UpdateShowDesktopState(); |
765 | 3358 | break; | 3358 | break; |
766 | 3359 | case CompWindowNotifyBeforeDestroy: | 3359 | case CompWindowNotifyBeforeDestroy: |
767 | 3360 | deco_win_->Undecorate(); | ||
768 | 3360 | being_destroyed.emit(); | 3361 | being_destroyed.emit(); |
769 | 3361 | break; | 3362 | break; |
770 | 3362 | case CompWindowNotifyMinimize: | 3363 | case CompWindowNotifyMinimize: |
771 | 3363 | 3364 | ||
772 | === modified file 'plugins/unityshell/unityshell.xml.in' | |||
773 | --- plugins/unityshell/unityshell.xml.in 2016-04-05 13:23:27 +0000 | |||
774 | +++ plugins/unityshell/unityshell.xml.in 2016-08-01 13:05:54 +0000 | |||
775 | @@ -39,6 +39,8 @@ | |||
776 | 39 | <plugin>compiztoolbox</plugin> | 39 | <plugin>compiztoolbox</plugin> |
777 | 40 | <plugin>scale</plugin> | 40 | <plugin>scale</plugin> |
778 | 41 | <plugin>expo</plugin> | 41 | <plugin>expo</plugin> |
779 | 42 | <plugin>move</plugin> | ||
780 | 43 | <plugin>resize</plugin> | ||
781 | 42 | </requirement> | 44 | </requirement> |
782 | 43 | <conflict> | 45 | <conflict> |
783 | 44 | <plugin>decor</plugin> | 46 | <plugin>decor</plugin> |
784 | 45 | 47 | ||
785 | === modified file 'tests/test_mock_devices.h' | |||
786 | --- tests/test_mock_devices.h 2016-01-24 14:35:49 +0000 | |||
787 | +++ tests/test_mock_devices.h 2016-08-01 13:05:54 +0000 | |||
788 | @@ -101,7 +101,7 @@ | |||
789 | 101 | typedef std::shared_ptr<MockDeviceNotificationDisplay> Ptr; | 101 | typedef std::shared_ptr<MockDeviceNotificationDisplay> Ptr; |
790 | 102 | typedef testing::NiceMock<MockDeviceNotificationDisplay> Nice; | 102 | typedef testing::NiceMock<MockDeviceNotificationDisplay> Nice; |
791 | 103 | 103 | ||
793 | 104 | MOCK_METHOD2(Display, void(std::string const& icon_name, std::string const& volume_name)); | 104 | MOCK_METHOD1(Display, void(std::string const& volume_name)); |
794 | 105 | }; | 105 | }; |
795 | 106 | 106 | ||
796 | 107 | } // anonymous namespace | 107 | } // anonymous namespace |
797 | 108 | 108 | ||
798 | === modified file 'tests/test_unity_window_view.cpp' | |||
799 | --- tests/test_unity_window_view.cpp 2016-03-31 02:03:55 +0000 | |||
800 | +++ tests/test_unity_window_view.cpp 2016-08-01 13:05:54 +0000 | |||
801 | @@ -82,12 +82,18 @@ | |||
802 | 82 | view.closable = true; | 82 | view.closable = true; |
803 | 83 | ASSERT_NE(view.close_button_, nullptr); | 83 | ASSERT_NE(view.close_button_, nullptr); |
804 | 84 | 84 | ||
805 | 85 | auto weak_ptr = nux::ObjectWeakPtr<IconTexture>(view.close_button_); | ||
806 | 86 | ASSERT_TRUE(weak_ptr.IsValid()); | ||
807 | 87 | |||
808 | 85 | EXPECT_EQ(view.close_button_->texture(), view.style()->GetTexture(view.scale, WindowTextureType::CLOSE_ICON)); | 88 | EXPECT_EQ(view.close_button_->texture(), view.style()->GetTexture(view.scale, WindowTextureType::CLOSE_ICON)); |
809 | 86 | EXPECT_EQ(view.close_button_->GetParentObject(), &view); | 89 | EXPECT_EQ(view.close_button_->GetParentObject(), &view); |
810 | 87 | 90 | ||
811 | 88 | int padding = view.style()->GetCloseButtonPadding().CP(view.scale); | 91 | int padding = view.style()->GetCloseButtonPadding().CP(view.scale); |
812 | 89 | EXPECT_EQ(view.close_button_->GetBaseX(), padding); | 92 | EXPECT_EQ(view.close_button_->GetBaseX(), padding); |
813 | 90 | EXPECT_EQ(view.close_button_->GetBaseY(), padding); | 93 | EXPECT_EQ(view.close_button_->GetBaseY(), padding); |
814 | 94 | |||
815 | 95 | view.closable = false; | ||
816 | 96 | ASSERT_FALSE(weak_ptr.IsValid()); | ||
817 | 91 | } | 97 | } |
818 | 92 | 98 | ||
819 | 93 | TEST_F(TestUnityWindowView, CloseButtonStates) | 99 | TEST_F(TestUnityWindowView, CloseButtonStates) |
820 | 94 | 100 | ||
821 | === modified file 'tests/test_volume_launcher_icon.cpp' | |||
822 | --- tests/test_volume_launcher_icon.cpp 2016-01-24 14:35:49 +0000 | |||
823 | +++ tests/test_volume_launcher_icon.cpp 2016-08-01 13:05:54 +0000 | |||
824 | @@ -481,7 +481,7 @@ | |||
825 | 481 | auto menuitem = GetMenuItemAtIndex(5); | 481 | auto menuitem = GetMenuItemAtIndex(5); |
826 | 482 | 482 | ||
827 | 483 | EXPECT_CALL(*volume_, Eject()); | 483 | EXPECT_CALL(*volume_, Eject()); |
829 | 484 | EXPECT_CALL(*notifications_, Display(volume_->GetIconName(), volume_->GetName())); | 484 | EXPECT_CALL(*notifications_, Display(volume_->GetName())); |
830 | 485 | 485 | ||
831 | 486 | ASSERT_STREQ(dbusmenu_menuitem_property_get(menuitem, DBUSMENU_MENUITEM_PROP_LABEL), "Eject"); | 486 | ASSERT_STREQ(dbusmenu_menuitem_property_get(menuitem, DBUSMENU_MENUITEM_PROP_LABEL), "Eject"); |
832 | 487 | EXPECT_TRUE(dbusmenu_menuitem_property_get_bool(menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE)); | 487 | EXPECT_TRUE(dbusmenu_menuitem_property_get_bool(menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE)); |
833 | @@ -573,7 +573,7 @@ | |||
834 | 573 | .WillRepeatedly(Return(true)); | 573 | .WillRepeatedly(Return(true)); |
835 | 574 | 574 | ||
836 | 575 | EXPECT_CALL(*volume_, Eject()); | 575 | EXPECT_CALL(*volume_, Eject()); |
838 | 576 | EXPECT_CALL(*notifications_, Display(volume_->GetIconName(), volume_->GetName())); | 576 | EXPECT_CALL(*notifications_, Display(volume_->GetName())); |
839 | 577 | icon_->EjectAndShowNotification(); | 577 | icon_->EjectAndShowNotification(); |
840 | 578 | } | 578 | } |
841 | 579 | 579 | ||
842 | 580 | 580 | ||
843 | === modified file 'tools/CMakeLists.txt' | |||
844 | --- tools/CMakeLists.txt 2016-02-09 01:26:22 +0000 | |||
845 | +++ tools/CMakeLists.txt 2016-08-01 13:05:54 +0000 | |||
846 | @@ -6,3 +6,25 @@ | |||
847 | 6 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/unity.cmake ${CMAKE_BINARY_DIR}/bin/unity) | 6 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/unity.cmake ${CMAKE_BINARY_DIR}/bin/unity) |
848 | 7 | install(FILES ${CMAKE_BINARY_DIR}/bin/unity PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ | 7 | install(FILES ${CMAKE_BINARY_DIR}/bin/unity PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ |
849 | 8 | GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_BINDIR}) | 8 | GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_BINDIR}) |
850 | 9 | |||
851 | 10 | # | ||
852 | 11 | # unity-active-plugins-safety-check | ||
853 | 12 | # | ||
854 | 13 | pkg_check_modules(UAPSC_DEPS REQUIRED libcompizconfig) | ||
855 | 14 | |||
856 | 15 | set(CFLAGS | ||
857 | 16 | ${UAPSC_DEPS_CFLAGS} | ||
858 | 17 | ${UAPSC_DEPS_CFLAGS_OTHER} | ||
859 | 18 | ) | ||
860 | 19 | |||
861 | 20 | string (REPLACE ";" " " CFLAGS "${CFLAGS}") | ||
862 | 21 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CFLAGS}") | ||
863 | 22 | |||
864 | 23 | set(LIBS ${UAPSC_DEPS_LIBRARIES}) | ||
865 | 24 | |||
866 | 25 | set(LIB_PATHS ${UAPSC_DEPS_LIBRARY_DIRS}) | ||
867 | 26 | link_directories(${LIB_PATHS}) | ||
868 | 27 | |||
869 | 28 | add_executable(unity-active-plugins-safety-check unity_active_plugins_safety_check.cpp) | ||
870 | 29 | target_link_libraries(unity-active-plugins-safety-check ${LIBS}) | ||
871 | 30 | install(TARGETS unity-active-plugins-safety-check DESTINATION ${CMAKE_INSTALL_LIBDIR}/unity/) | ||
872 | 9 | 31 | ||
873 | === modified file 'tools/unity.cmake' | |||
874 | --- tools/unity.cmake 2016-04-08 18:13:40 +0000 | |||
875 | +++ tools/unity.cmake 2016-08-01 13:05:54 +0000 | |||
876 | @@ -59,6 +59,12 @@ | |||
877 | 59 | 59 | ||
878 | 60 | os.environ['COMPIZ_CONFIG_PROFILE'] = 'ubuntu' | 60 | os.environ['COMPIZ_CONFIG_PROFILE'] = 'ubuntu' |
879 | 61 | 61 | ||
880 | 62 | try: | ||
881 | 63 | if subprocess.call('/usr/lib/nux/unity_support_test -f'.split()) > 0: | ||
882 | 64 | os.environ['COMPIZ_CONFIG_PROFILE'] = 'ubuntu-lowgfx' | ||
883 | 65 | except: | ||
884 | 66 | pass | ||
885 | 67 | |||
886 | 62 | if not 'DISPLAY' in os.environ: | 68 | if not 'DISPLAY' in os.environ: |
887 | 63 | # take an optimistic chance and warn about it :) | 69 | # take an optimistic chance and warn about it :) |
888 | 64 | print("WARNING: no DISPLAY variable set, setting it to :0") | 70 | print("WARNING: no DISPLAY variable set, setting it to :0") |
889 | 65 | 71 | ||
890 | === added file 'tools/unity_active_plugins_safety_check.cpp' | |||
891 | --- tools/unity_active_plugins_safety_check.cpp 1970-01-01 00:00:00 +0000 | |||
892 | +++ tools/unity_active_plugins_safety_check.cpp 2016-08-01 13:05:54 +0000 | |||
893 | @@ -0,0 +1,83 @@ | |||
894 | 1 | /* | ||
895 | 2 | * Copyright (C) 2016 Canonical Ltd | ||
896 | 3 | * | ||
897 | 4 | * This program is free software: you can redistribute it and/or modify | ||
898 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
899 | 6 | * published by the Free Software Foundation. | ||
900 | 7 | * | ||
901 | 8 | * This program is distributed in the hope that it will be useful, | ||
902 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
903 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
904 | 11 | * GNU General Public License for more details. | ||
905 | 12 | * | ||
906 | 13 | * You should have received a copy of the GNU General Public License | ||
907 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
908 | 15 | * | ||
909 | 16 | * Authored by: Andrea Azzarone <andrea.azzarone@canonical.com> | ||
910 | 17 | */ | ||
911 | 18 | |||
912 | 19 | #include <ccs.h> | ||
913 | 20 | #include <gio/gio.h> | ||
914 | 21 | |||
915 | 22 | #include <iostream> | ||
916 | 23 | #include <string> | ||
917 | 24 | |||
918 | 25 | extern const CCSInterfaceTable ccsDefaultInterfaceTable; | ||
919 | 26 | |||
920 | 27 | void PluginSetActiveWithDeps(CCSContext* context, std::string const& plugin_name) | ||
921 | 28 | { | ||
922 | 29 | if (plugin_name.empty()) | ||
923 | 30 | return; | ||
924 | 31 | |||
925 | 32 | auto plugin = ccsFindPlugin(context, plugin_name.c_str()); | ||
926 | 33 | |||
927 | 34 | if (!plugin) | ||
928 | 35 | return; | ||
929 | 36 | |||
930 | 37 | auto reqs = ccsPluginGetRequiresPlugins(plugin); | ||
931 | 38 | for (auto req = reqs; req; req = req->next) | ||
932 | 39 | { | ||
933 | 40 | if (req->data && req->data->value) | ||
934 | 41 | { | ||
935 | 42 | std::string name = req->data->value; | ||
936 | 43 | PluginSetActiveWithDeps(context, name.c_str()); | ||
937 | 44 | } | ||
938 | 45 | } | ||
939 | 46 | |||
940 | 47 | if (!ccsPluginIsActive(context, plugin_name.c_str())) { | ||
941 | 48 | std::cout << "Setting plugin '" << plugin_name << "' to active" << std::endl; | ||
942 | 49 | ccsPluginSetActive(plugin, true); | ||
943 | 50 | } | ||
944 | 51 | |||
945 | 52 | auto conflicts = ccsPluginGetConflictPlugins(plugin); | ||
946 | 53 | for (auto con = conflicts; con; con = con->next) | ||
947 | 54 | { | ||
948 | 55 | if (con->data && con->data->value) | ||
949 | 56 | { | ||
950 | 57 | std::string name = con->data->value; | ||
951 | 58 | auto plugin = ccsFindPlugin(context, name.c_str()); | ||
952 | 59 | |||
953 | 60 | if (ccsPluginIsActive(context, name.c_str())) | ||
954 | 61 | { | ||
955 | 62 | std::cout << "Setting plugin '" << name << "' to non-active" << std::endl; | ||
956 | 63 | ccsPluginSetActive(plugin, false); | ||
957 | 64 | } | ||
958 | 65 | } | ||
959 | 66 | } | ||
960 | 67 | } | ||
961 | 68 | |||
962 | 69 | int main() | ||
963 | 70 | { | ||
964 | 71 | auto context = ccsContextNew (0, &ccsDefaultInterfaceTable); | ||
965 | 72 | |||
966 | 73 | if (!context) | ||
967 | 74 | return -1; | ||
968 | 75 | |||
969 | 76 | PluginSetActiveWithDeps(context, "unityshell"); | ||
970 | 77 | |||
971 | 78 | ccsWriteChangedSettings(context); | ||
972 | 79 | g_settings_sync(); | ||
973 | 80 | ccsFreeContext(context); | ||
974 | 81 | |||
975 | 82 | return 0; | ||
976 | 83 | } | ||
977 | 0 | 84 | ||
978 | === modified file 'unity-shared/CompizUtils.cpp' | |||
979 | --- unity-shared/CompizUtils.cpp 2015-11-02 14:58:01 +0000 | |||
980 | +++ unity-shared/CompizUtils.cpp 2016-08-01 13:05:54 +0000 | |||
981 | @@ -211,11 +211,10 @@ | |||
982 | 211 | } | 211 | } |
983 | 212 | } | 212 | } |
984 | 213 | 213 | ||
987 | 214 | if (region.boundingRect() != win->geometry()) // Shaped windows | 214 | elements |= DecorationElement::SHADOW; |
986 | 215 | return elements; | ||
988 | 216 | 215 | ||
991 | 217 | if (rectangular) | 216 | if (!rectangular) |
992 | 218 | elements |= DecorationElement::SHADOW; | 217 | elements |= DecorationElement::SHAPED; |
993 | 219 | 218 | ||
994 | 220 | if (!win->overrideRedirect() && | 219 | if (!win->overrideRedirect() && |
995 | 221 | (win->type() & DECORABLE_WINDOW_TYPES) && | 220 | (win->type() & DECORABLE_WINDOW_TYPES) && |
996 | 222 | 221 | ||
997 | === modified file 'unity-shared/CompizUtils.h' | |||
998 | --- unity-shared/CompizUtils.h 2015-11-02 14:58:01 +0000 | |||
999 | +++ unity-shared/CompizUtils.h 2016-08-01 13:05:54 +0000 | |||
1000 | @@ -133,7 +133,8 @@ | |||
1001 | 133 | NONE = 0, | 133 | NONE = 0, |
1002 | 134 | EDGE = (1 << 0), | 134 | EDGE = (1 << 0), |
1003 | 135 | SHADOW = (1 << 1), | 135 | SHADOW = (1 << 1), |
1005 | 136 | BORDER = (1 << 2), | 136 | SHAPED = (1 << 2), |
1006 | 137 | BORDER = (1 << 3), | ||
1007 | 137 | FULL = EDGE|SHADOW|BORDER | 138 | FULL = EDGE|SHADOW|BORDER |
1008 | 138 | }; | 139 | }; |
1009 | 139 | } | 140 | } |
1010 | 140 | 141 | ||
1011 | === modified file 'unity-shared/PluginAdapter.cpp' | |||
1012 | --- unity-shared/PluginAdapter.cpp 2016-03-18 18:58:26 +0000 | |||
1013 | +++ unity-shared/PluginAdapter.cpp 2016-08-01 13:05:54 +0000 | |||
1014 | @@ -630,7 +630,7 @@ | |||
1015 | 630 | CompWindow* window = m_Screen->findWindow(window_id); | 630 | CompWindow* window = m_Screen->findWindow(window_id); |
1016 | 631 | if (window) | 631 | if (window) |
1017 | 632 | return window->mapNum () > 0; | 632 | return window->mapNum () > 0; |
1019 | 633 | return true; | 633 | return false; |
1020 | 634 | } | 634 | } |
1021 | 635 | 635 | ||
1022 | 636 | bool PluginAdapter::IsWindowVisible(Window window_id) const | 636 | bool PluginAdapter::IsWindowVisible(Window window_id) const |
1023 | 637 | 637 | ||
1024 | === modified file 'unity-shared/TextInput.cpp' | |||
1025 | --- unity-shared/TextInput.cpp 2016-03-31 05:57:11 +0000 | |||
1026 | +++ unity-shared/TextInput.cpp 2016-08-01 13:05:54 +0000 | |||
1027 | @@ -104,7 +104,6 @@ | |||
1028 | 104 | , scale(1.0) | 104 | , scale(1.0) |
1029 | 105 | , bg_layer_(new nux::ColorLayer(nux::Color(0xff595853), true)) | 105 | , bg_layer_(new nux::ColorLayer(nux::Color(0xff595853), true)) |
1030 | 106 | , caps_lock_on(false) | 106 | , caps_lock_on(false) |
1031 | 107 | , num_lock_on(false) | ||
1032 | 108 | , last_width_(-1) | 107 | , last_width_(-1) |
1033 | 109 | , last_height_(-1) | 108 | , last_height_(-1) |
1034 | 110 | { | 109 | { |
1035 | @@ -146,9 +145,8 @@ | |||
1036 | 146 | 145 | ||
1037 | 147 | // Caps lock warning | 146 | // Caps lock warning |
1038 | 148 | warning_ = new IconTexture(LoadWarningIcon(DEFAULT_ICON_SIZE.CP(scale))); | 147 | warning_ = new IconTexture(LoadWarningIcon(DEFAULT_ICON_SIZE.CP(scale))); |
1040 | 149 | warning_->SetVisible(caps_lock_on() || num_lock_on()); | 148 | warning_->SetVisible(caps_lock_on()); |
1041 | 150 | layout_->AddView(warning_, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL); | 149 | layout_->AddView(warning_, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL); |
1042 | 151 | num_lock_on.changed.connect(sigc::mem_fun(this, &TextInput::OnLockStateChanged)); | ||
1043 | 152 | caps_lock_on.changed.connect(sigc::mem_fun(this, &TextInput::OnLockStateChanged)); | 150 | caps_lock_on.changed.connect(sigc::mem_fun(this, &TextInput::OnLockStateChanged)); |
1044 | 153 | 151 | ||
1045 | 154 | show_lock_warnings.changed.connect(sigc::hide(sigc::mem_fun(this, &TextInput::CheckLocks))); | 152 | show_lock_warnings.changed.connect(sigc::hide(sigc::mem_fun(this, &TextInput::CheckLocks))); |
1046 | @@ -249,7 +247,6 @@ | |||
1047 | 249 | { | 247 | { |
1048 | 250 | GdkKeymap* keymap = gdk_keymap_get_default(); | 248 | GdkKeymap* keymap = gdk_keymap_get_default(); |
1049 | 251 | caps_lock_on = gdk_keymap_get_caps_lock_state(keymap) ? true : false; | 249 | caps_lock_on = gdk_keymap_get_caps_lock_state(keymap) ? true : false; |
1050 | 252 | num_lock_on = gdk_keymap_get_num_lock_state(keymap) ? true : false; | ||
1051 | 253 | } | 250 | } |
1052 | 254 | 251 | ||
1053 | 255 | void TextInput::OnLockStateChanged(bool) | 252 | void TextInput::OnLockStateChanged(bool) |
1054 | @@ -260,8 +257,8 @@ | |||
1055 | 260 | return; | 257 | return; |
1056 | 261 | } | 258 | } |
1057 | 262 | 259 | ||
1060 | 263 | warning_->SetVisible(caps_lock_on() || num_lock_on()); | 260 | warning_->SetVisible(caps_lock_on()); |
1061 | 264 | warning_->SetOpacity((num_lock_on() && !caps_lock_on()) ? 0.3 : 1.0); | 261 | warning_->SetOpacity(1.0); |
1062 | 265 | warning_tooltip_.Release(); | 262 | warning_tooltip_.Release(); |
1063 | 266 | QueueRelayout(); | 263 | QueueRelayout(); |
1064 | 267 | QueueDraw(); | 264 | QueueDraw(); |
1065 | @@ -345,18 +342,10 @@ | |||
1066 | 345 | 342 | ||
1067 | 346 | pango_layout_set_height(layout, -1); //avoid wrap lines | 343 | pango_layout_set_height(layout, -1); //avoid wrap lines |
1068 | 347 | 344 | ||
1074 | 348 | if (caps_lock_on() && num_lock_on()) | 345 | if (caps_lock_on()) |
1070 | 349 | { | ||
1071 | 350 | pango_layout_set_text(layout, _("Caps lock and Num lock are on"), -1); | ||
1072 | 351 | } | ||
1073 | 352 | else if (caps_lock_on()) | ||
1075 | 353 | { | 346 | { |
1076 | 354 | pango_layout_set_text(layout, _("Caps lock is on"), -1); | 347 | pango_layout_set_text(layout, _("Caps lock is on"), -1); |
1077 | 355 | } | 348 | } |
1078 | 356 | else if (num_lock_on()) | ||
1079 | 357 | { | ||
1080 | 358 | pango_layout_set_text(layout, _("Num lock is on"), -1); | ||
1081 | 359 | } | ||
1082 | 360 | 349 | ||
1083 | 361 | nux::Size extents; | 350 | nux::Size extents; |
1084 | 362 | pango_layout_get_pixel_size(layout, &extents.width, &extents.height); | 351 | pango_layout_get_pixel_size(layout, &extents.width, &extents.height); |
1085 | 363 | 352 | ||
1086 | === modified file 'unity-shared/TextInput.h' | |||
1087 | --- unity-shared/TextInput.h 2016-03-31 05:57:11 +0000 | |||
1088 | +++ unity-shared/TextInput.h 2016-08-01 13:05:54 +0000 | |||
1089 | @@ -124,7 +124,6 @@ | |||
1090 | 124 | SearchBarSpinner* spinner_; | 124 | SearchBarSpinner* spinner_; |
1091 | 125 | 125 | ||
1092 | 126 | nux::Property<bool> caps_lock_on; | 126 | nux::Property<bool> caps_lock_on; |
1093 | 127 | nux::Property<bool> num_lock_on; | ||
1094 | 128 | int last_width_; | 127 | int last_width_; |
1095 | 129 | int last_height_; | 128 | int last_height_; |
1096 | 130 | 129 | ||
1097 | 131 | 130 | ||
1098 | === modified file 'unity-shared/UnityWindowView.cpp' | |||
1099 | --- unity-shared/UnityWindowView.cpp 2016-07-05 10:22:42 +0000 | |||
1100 | +++ unity-shared/UnityWindowView.cpp 2016-08-01 13:05:54 +0000 | |||
1101 | @@ -145,7 +145,12 @@ | |||
1102 | 145 | { | 145 | { |
1103 | 146 | if (!closable) | 146 | if (!closable) |
1104 | 147 | { | 147 | { |
1106 | 148 | close_button_ = nullptr; | 148 | if (close_button_) |
1107 | 149 | { | ||
1108 | 150 | close_button_->UnParentObject(); | ||
1109 | 151 | close_button_ = nullptr; | ||
1110 | 152 | } | ||
1111 | 153 | |||
1112 | 149 | return; | 154 | return; |
1113 | 150 | } | 155 | } |
1114 | 151 | 156 | ||
1115 | 152 | 157 | ||
1116 | === renamed file 'debian/unity7.conf' => 'unity7.conf.in' | |||
1117 | --- debian/unity7.conf 2016-07-05 10:22:49 +0000 | |||
1118 | +++ unity7.conf.in 2016-08-01 13:05:54 +0000 | |||
1119 | @@ -21,6 +21,9 @@ | |||
1120 | 21 | 21 | ||
1121 | 22 | echo "Using compiz profile '$compiz_profile'" | 22 | echo "Using compiz profile '$compiz_profile'" |
1122 | 23 | initctl set-env -g COMPIZ_CONFIG_PROFILE="$compiz_profile" | 23 | initctl set-env -g COMPIZ_CONFIG_PROFILE="$compiz_profile" |
1123 | 24 | export COMPIZ_CONFIG_PROFILE="$compiz_profile" | ||
1124 | 25 | |||
1125 | 26 | ${CMAKE_INSTALL_FULL_LIBDIR}/unity/unity-active-plugins-safety-check | ||
1126 | 24 | end script | 27 | end script |
1127 | 25 | 28 | ||
1128 | 26 | respawn | 29 | respawn |
+1