Merge lp:~unity-team/unity/x-sru3 into lp:unity/7.4

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
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
Review via email: mp+301625@code.launchpad.net

Commit message

Releasing Unity Xenial SRU3.

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2016-05-14 23:01:37 +0000
+++ CMakeLists.txt 2016-08-01 13:05:54 +0000
@@ -425,3 +425,9 @@
425 ADDITIONAL_MAKE_CLEAN_FILES api-doc)425 ADDITIONAL_MAKE_CLEAN_FILES api-doc)
426426
427endif (DOXYGEN_FOUND STREQUAL "YES")427endif (DOXYGEN_FOUND STREQUAL "YES")
428
429#
430# Upstart
431#
432configure_file(unity7.conf.in ${CMAKE_CURRENT_BINARY_DIR}/unity7.conf)
433install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unity7.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/sessions)
428434
=== modified file 'debian/changelog'
--- debian/changelog 2016-07-15 10:14:41 +0000
+++ debian/changelog 2016-08-01 13:05:54 +0000
@@ -1,3 +1,38 @@
1unity (7.4.0+16.04.20160715-0ubuntu2) UNRELEASED; urgency=medium
2
3 [ Andrea Azzarone ]
4 * FileManagerLauncherIcon: Don't trust the Quirk::VISIBLE in the ctor.
5 (LP: #1599133)
6 * [TrashLauncherIcon] Create GFileMonitor in an idle to avoid blocking
7 calls. (LP: #1602720)
8 * [LockSceen] Remove numlock warning. (LP: #1526322)
9 * Make sure initiate and terminate callbacks are not empty before
10 calling them. (LP: #1605012)
11 * Properly destroy close_button_ to properly disconnect lambda. (LP:
12 #1605010)
13 * Use the standard notification-device-eject in the "device eject"
14 notification. This allows us to scale it properly on high-dpi
15 setups. (LP: #1605231)
16 * Add tools to enforce unityshell plugin for the current profile and
17 add "move" and "resize" plugins as requirements. (LP: #1506023, LP:
18 #1605007, LP: #1604657)
19
20 [ Marco Trevisan (Treviño) ]
21 * Unity script: use result from unity_support_test to check the right
22 COMPIZ_CONFIG_PROFILE to use (LP: #1602377)
23 * LockScreenAcceleratorController: ensure callbacks are valid before
24 calling them (LP: #1605012)
25
26 [ Eleni Maria Stea ]
27 * DecoratedWindow: Added shadows for shaped windows (LP: 1608418)
28
29 [ Marco Trevisan (Treviño) ]
30 * DecoratedWindow: Cleanup shadows for shaped windows, reduce
31 recomputation (LP: #1608418)
32 * UnityWindowView: don't try to deference close_button_ if its' null
33
34 -- Andrea Azzarone <azzaronea@gmail.com> Mon, 01 Aug 2016 10:34:14 +0200
35
1unity (7.4.0+16.04.20160715-0ubuntu1) xenial; urgency=medium36unity (7.4.0+16.04.20160715-0ubuntu1) xenial; urgency=medium
237
3 [ Eleni Maria Stea ]38 [ Eleni Maria Stea ]
439
=== modified file 'debian/control'
--- debian/control 2016-03-21 15:38:17 +0000
+++ debian/control 2016-08-01 13:05:54 +0000
@@ -18,6 +18,7 @@
18 libbamf3-dev (>= 0.5.3~bzr0),18 libbamf3-dev (>= 0.5.3~bzr0),
19 libboost-dev,19 libboost-dev,
20 libcairo2-dev,20 libcairo2-dev,
21 libcompizconfig0-dev,
21 libdbus-1-dev,22 libdbus-1-dev,
22 libdbusmenu-glib-dev (>= 0.3.91),23 libdbusmenu-glib-dev (>= 0.3.91),
23 libdee-dev (>= 1.2.6),24 libdee-dev (>= 1.2.6),
2425
=== modified file 'debian/libunity-core-6.0-9.install'
--- debian/libunity-core-6.0-9.install 2016-02-09 01:26:22 +0000
+++ debian/libunity-core-6.0-9.install 2016-08-01 13:05:54 +0000
@@ -3,7 +3,7 @@
3usr/share/ccsm3usr/share/ccsm
4usr/share/gnome-control-center/4usr/share/gnome-control-center/
5usr/share/unity5usr/share/unity
6usr/share/upstart/sessions/unity7.conf
6debian/unity-crashdb.conf etc/apport/crashdb.conf.d/7debian/unity-crashdb.conf etc/apport/crashdb.conf.d/
7debian/source_unity.py usr/share/apport/package-hooks8debian/source_unity.py usr/share/apport/package-hooks
8debian/unity7.conf usr/share/upstart/sessions
9tools/convert-files/* usr/lib/compiz/migration/9tools/convert-files/* usr/lib/compiz/migration/
1010
=== modified file 'debian/unity-services.install'
--- debian/unity-services.install 2016-02-09 01:26:22 +0000
+++ debian/unity-services.install 2016-08-01 13:05:54 +0000
@@ -1,3 +1,3 @@
1usr/lib/*/unity/*service1usr/lib/*/unity/*service
2usr/share/upstart2usr/share/upstart/sessions/unity-panel-service*.conf
3usr/share/man/*/unity-panel-service.13usr/share/man/*/unity-panel-service.1
44
=== modified file 'debian/unity.install'
--- debian/unity.install 2016-02-09 01:26:22 +0000
+++ debian/unity.install 2016-08-01 13:05:54 +0000
@@ -1,6 +1,7 @@
1etc/pam.d1etc/pam.d
2usr/bin2usr/bin
3usr/lib/*/compiz/libunity*.so3usr/lib/*/compiz/libunity*.so
4usr/lib/*/unity/unity-active-plugins-safety-check
4usr/share/man/*/unity.15usr/share/man/*/unity.1
5usr/share/compiz6usr/share/compiz
6usr/share/locale7usr/share/locale
78
=== modified file 'decorations/CMakeLists.txt'
--- decorations/CMakeLists.txt 2014-03-27 19:32:34 +0000
+++ decorations/CMakeLists.txt 2016-08-01 13:05:54 +0000
@@ -35,6 +35,7 @@
35 DecorationsMenuDropdown.cpp35 DecorationsMenuDropdown.cpp
36 DecorationsForceQuitDialog.cpp36 DecorationsForceQuitDialog.cpp
37 DecorationsDataPool.cpp37 DecorationsDataPool.cpp
38 DecorationsShape.cpp
38 )39 )
3940
40add_library (decorations-lib STATIC ${DECORATION_SOURCES})41add_library (decorations-lib STATIC ${DECORATION_SOURCES})
4142
=== modified file 'decorations/DecoratedWindow.cpp'
--- decorations/DecoratedWindow.cpp 2016-04-01 00:50:30 +0000
+++ decorations/DecoratedWindow.cpp 2016-08-01 13:05:54 +0000
@@ -38,6 +38,7 @@
38namespace38namespace
39{39{
40const std::string MENUS_PANEL_NAME = "WindowLIM";40const std::string MENUS_PANEL_NAME = "WindowLIM";
41const int SHADOW_BLUR_MARGIN_FACTOR = 2;
41}42}
4243
43Window::Impl::Impl(Window* parent, CompWindow* win)44Window::Impl::Impl(Window* parent, CompWindow* win)
@@ -492,6 +493,12 @@
492 return deco_elements_ & cu::DecorationElement::SHADOW;493 return deco_elements_ & cu::DecorationElement::SHADOW;
493}494}
494495
496bool Window::Impl::ShapedShadowDecorated() const
497{
498 return deco_elements_ & cu::DecorationElement::SHADOW &&
499 deco_elements_ & cu::DecorationElement::SHAPED;
500}
501
495bool Window::Impl::FullyDecorated() const502bool Window::Impl::FullyDecorated() const
496{503{
497 return deco_elements_ & cu::DecorationElement::BORDER;504 return deco_elements_ & cu::DecorationElement::BORDER;
@@ -504,6 +511,14 @@
504511
505GLTexture* Window::Impl::ShadowTexture() const512GLTexture* Window::Impl::ShadowTexture() const
506{513{
514 if (shaped_shadow_pixmap_)
515 return shaped_shadow_pixmap_->texture();
516
517 return SharedShadowTexture();
518}
519
520GLTexture* Window::Impl::SharedShadowTexture() const
521{
507 auto const& mi = manager_->impl_;522 auto const& mi = manager_->impl_;
508 if (active() || parent_->scaled())523 if (active() || parent_->scaled())
509 return mi->active_shadow_pixmap_->texture();524 return mi->active_shadow_pixmap_->texture();
@@ -569,10 +584,22 @@
569 if (!last_shadow_rect_.isEmpty())584 if (!last_shadow_rect_.isEmpty())
570 last_shadow_rect_.setGeometry(0, 0, 0, 0);585 last_shadow_rect_.setGeometry(0, 0, 0, 0);
571586
572 return;587 shaped_shadow_pixmap_.reset();
573 }588 }
589 else if (deco_elements_ & cu::DecorationElement::SHAPED)
590 {
591 ComputeShapedShadowQuad();
592 }
593 else
594 {
595 shaped_shadow_pixmap_.reset();
596 ComputeGenericShadowQuads();
597 }
598}
574599
575 const auto* texture = ShadowTexture();600void Window::Impl::ComputeGenericShadowQuads()
601{
602 const auto* texture = SharedShadowTexture();
576603
577 if (!texture || !texture->width() || !texture->height())604 if (!texture || !texture->width() || !texture->height())
578 return;605 return;
@@ -676,6 +703,68 @@
676 }703 }
677}704}
678705
706cu::PixmapTexture::Ptr Window::Impl::BuildShapedShadowTexture(nux::Size const& size, unsigned radius, nux::Color const& color, Shape const& shape) {
707 nux::CairoGraphics img(CAIRO_FORMAT_ARGB32, size.width, size.height);
708 auto* img_ctx = img.GetInternalContext();
709
710 for (auto const& rect : shape.GetRectangles())
711 {
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);
713 cairo_set_source_rgba(img_ctx, color.red, color.green, color.blue, color.alpha);
714 cairo_fill(img_ctx);
715 }
716
717 img.BlurSurface(radius);
718
719 cu::CairoContext shadow_ctx(size.width, size.height);
720 cairo_set_source_surface(shadow_ctx, img.GetSurface(), 0, 0);
721 cairo_paint(shadow_ctx);
722
723 return shadow_ctx;
724}
725
726void Window::Impl::ComputeShapedShadowQuad()
727{
728 nux::Color color = active() ? manager_->active_shadow_color() : manager_->inactive_shadow_color();
729 unsigned int radius = active() ? manager_->active_shadow_radius() : manager_->inactive_shadow_radius();
730
731 Shape shape(win_->id());
732 auto const& border = win_->borderRect();
733 auto const& shadow_offset = manager_->shadow_offset();
734
735 // Ideally it would be shape.getWidth + radius * 2 but Cairographics::BlurSurface
736 // isn't bounded by the radius and we need to compensate by using a larger texture.
737 int width = shape.Width() + radius * 2 * SHADOW_BLUR_MARGIN_FACTOR;
738 int height = shape.Height() + radius * 2 * SHADOW_BLUR_MARGIN_FACTOR;
739
740 if (width != last_shadow_rect_.width() || height != last_shadow_rect_.height())
741 shaped_shadow_pixmap_ = BuildShapedShadowTexture({width, height}, radius, color, shape);
742
743 const auto* texture = shaped_shadow_pixmap_->texture();
744
745 if (!texture || !texture->width() || !texture->height())
746 return;
747
748 int x = border.x() + shadow_offset.x - radius * 2 + shape.XOffset();
749 int y = border.y() + shadow_offset.y - radius * 2 + shape.YOffset();
750
751 auto* quad = &shadow_quads_[Quads::Pos(0)];
752 quad->box.setGeometry(x, y, width, height);
753 quad->matrix = texture->matrix();
754 quad->matrix.x0 = -COMP_TEX_COORD_X(quad->matrix, quad->box.x1());
755 quad->matrix.y0 = -COMP_TEX_COORD_Y(quad->matrix, quad->box.y1());
756
757 CompRect shaped_shadow_rect(x, y, width, height);
758 if (shaped_shadow_rect != last_shadow_rect_)
759 {
760 auto const& win_region = win_->region();
761 quad->region = CompRegion(quad->box) - win_region;
762
763 last_shadow_rect_ = shaped_shadow_rect;
764 win_->updateWindowOutputExtents();
765 }
766}
767
679void Window::Impl::Paint(GLMatrix const& transformation,768void Window::Impl::Paint(GLMatrix const& transformation,
680 GLWindowPaintAttrib const& attrib,769 GLWindowPaintAttrib const& attrib,
681 CompRegion const& region, unsigned mask)770 CompRegion const& region, unsigned mask)
@@ -714,14 +803,18 @@
714803
715 glwin_->vertexBuffer()->begin();804 glwin_->vertexBuffer()->begin();
716805
717 for (unsigned i = 0; i < shadow_quads_.size(); ++i)806 unsigned int num_quads = ShapedShadowDecorated() ? 1 : shadow_quads_.size();
807 for (unsigned int i = 0; i < num_quads; ++i)
718 {808 {
719 auto& quad = shadow_quads_[Quads::Pos(i)];809 auto& quad = shadow_quads_[Quads::Pos(i)];
720 glwin_->glAddGeometry(quad.matrices, quad.region, clip_region);810 glwin_->glAddGeometry(quad.matrices, quad.region, clip_region);
721 }811 }
722812
723 if (glwin_->vertexBuffer()->end())813 if (glwin_->vertexBuffer()->end())
724 glwin_->glDrawTexture(ShadowTexture(), transformation, attrib, mask);814 {
815 if (GLTexture* texture = ShadowTexture())
816 glwin_->glDrawTexture(texture, transformation, attrib, mask);
817 }
725818
726 for (auto const& dtex : bg_textures_)819 for (auto const& dtex : bg_textures_)
727 {820 {
@@ -746,6 +839,9 @@
746839
747void Window::Impl::RedrawDecorations()840void Window::Impl::RedrawDecorations()
748{841{
842 if (!win_->isMapped())
843 return;
844
749 dirty_geo_ = true;845 dirty_geo_ = true;
750 cwin_->damageOutputExtents();846 cwin_->damageOutputExtents();
751}847}
752848
=== modified file 'decorations/DecoratedWindow.h'
--- decorations/DecoratedWindow.h 2015-08-07 18:54:07 +0000
+++ decorations/DecoratedWindow.h 2016-08-01 13:05:54 +0000
@@ -21,6 +21,7 @@
21#define UNITY_DECORATED_WINDOW21#define UNITY_DECORATED_WINDOW
2222
23#include "Introspectable.h"23#include "Introspectable.h"
24#include <NuxCore/Property.h>
24#include <memory>25#include <memory>
2526
26class CompRegion;27class CompRegion;
2728
=== modified file 'decorations/DecorationsManager.cpp'
--- decorations/DecorationsManager.cpp 2016-03-09 17:28:36 +0000
+++ decorations/DecorationsManager.cpp 2016-08-01 13:05:54 +0000
@@ -20,9 +20,9 @@
20#include "DecorationsPriv.h"20#include "DecorationsPriv.h"
2121
22#include <core/atoms.h>22#include <core/atoms.h>
23#include <NuxGraphics/CairoGraphics.h>
24#include <UnityCore/DBusIndicators.h>23#include <UnityCore/DBusIndicators.h>
25#include <X11/Xatom.h>24#include <X11/Xatom.h>
25
26#include "WindowManager.h"26#include "WindowManager.h"
2727
28namespace unity28namespace unity
2929
=== modified file 'decorations/DecorationsPriv.h'
--- decorations/DecorationsPriv.h 2016-04-01 00:50:30 +0000
+++ decorations/DecorationsPriv.h 2016-08-01 13:05:54 +0000
@@ -23,6 +23,7 @@
23#include <unordered_map>23#include <unordered_map>
24#include <NuxCore/NuxCore.h>24#include <NuxCore/NuxCore.h>
25#include <NuxCore/Rect.h>25#include <NuxCore/Rect.h>
26#include <NuxGraphics/CairoGraphics.h>
26#include <UnityCore/ConnectionManager.h>27#include <UnityCore/ConnectionManager.h>
27#include <UnityCore/Indicators.h>28#include <UnityCore/Indicators.h>
28#include <core/core.h>29#include <core/core.h>
@@ -30,6 +31,7 @@
30#include <composite/composite.h>31#include <composite/composite.h>
31#include <X11/extensions/shape.h>32#include <X11/extensions/shape.h>
3233
34#include "DecorationsShape.h"
33#include "DecorationsDataPool.h"35#include "DecorationsDataPool.h"
34#include "DecorationsManager.h"36#include "DecorationsManager.h"
35#include "DecorationsInputMixer.h"37#include "DecorationsInputMixer.h"
@@ -88,6 +90,7 @@
88 bool IsMaximized() const;90 bool IsMaximized() const;
89 bool FullyDecorated() const;91 bool FullyDecorated() const;
90 bool ShadowDecorated() const;92 bool ShadowDecorated() const;
93 bool ShapedShadowDecorated() const;
91 void RedrawDecorations();94 void RedrawDecorations();
92 void Damage();95 void Damage();
93 void SetupAppMenu();96 void SetupAppMenu();
@@ -117,14 +120,18 @@
117 void SyncMenusGeometries() const;120 void SyncMenusGeometries() const;
118 bool ShouldBeDecorated() const;121 bool ShouldBeDecorated() const;
119 GLTexture* ShadowTexture() const;122 GLTexture* ShadowTexture() const;
123 GLTexture* SharedShadowTexture() const;
120 unsigned ShadowRadius() const;124 unsigned ShadowRadius() const;
121 std::string const& GetMenusPanelID() const;125 std::string const& GetMenusPanelID() const;
122126
123 void ComputeShadowQuads();127 void ComputeShadowQuads();
128 void ComputeGenericShadowQuads();
129 void ComputeShapedShadowQuad();
124 void UpdateDecorationTextures();130 void UpdateDecorationTextures();
125 void UpdateWindowEdgesGeo();131 void UpdateWindowEdgesGeo();
126 void UpdateForceQuitDialogPosition();132 void UpdateForceQuitDialogPosition();
127 void RenderDecorationTexture(Side, nux::Geometry const&);133 void RenderDecorationTexture(Side, nux::Geometry const&);
134 cu::PixmapTexture::Ptr BuildShapedShadowTexture(nux::Size const&, unsigned radius, nux::Color const&, Shape const&);
128 void Paint(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask);135 void Paint(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask);
129 void Draw(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask);136 void Draw(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask);
130137
@@ -155,6 +162,7 @@
155 std::string last_title_;162 std::string last_title_;
156 std::string panel_id_;163 std::string panel_id_;
157 std::vector<cu::SimpleTextureQuad> bg_textures_;164 std::vector<cu::SimpleTextureQuad> bg_textures_;
165 cu::PixmapTexture::Ptr shaped_shadow_pixmap_;
158 std::shared_ptr<ForceQuitDialog> force_quit_;166 std::shared_ptr<ForceQuitDialog> force_quit_;
159 InputMixer::Ptr input_mixer_;167 InputMixer::Ptr input_mixer_;
160 Layout::Ptr top_layout_;168 Layout::Ptr top_layout_;
161169
=== added file 'decorations/DecorationsShape.cpp'
--- decorations/DecorationsShape.cpp 1970-01-01 00:00:00 +0000
+++ decorations/DecorationsShape.cpp 2016-08-01 13:05:54 +0000
@@ -0,0 +1,107 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/*
3 * Copyright (C) 2016 Canonical Ltd
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authored by: Eleni Maria Stea <elenimaria.stea@canonical.com>
18 */
19
20#include "DecorationsShape.h"
21
22#include <core/core.h>
23#include <NuxCore/Logger.h>
24#include <X11/extensions/shape.h>
25
26namespace unity
27{
28namespace decoration
29{
30namespace
31{
32DECLARE_LOGGER(logger, "unity.decoration.shape");
33}
34
35Shape::Shape(Window xid)
36{
37 Bool buse, cuse;
38 int bx, by, cx, cy;
39 unsigned int bw, bh, cw, ch;
40 Display *dpy = screen->dpy();
41
42 XShapeQueryExtents(dpy, xid, &buse, &bx, &by, &bw, &bh, &cuse, &cx, &cy, &cw, &ch);
43
44 int kind;
45
46 if (buse)
47 {
48 width_ = bw;
49 height_ = bh;
50 xoffs_ = bx;
51 yoffs_ = by;
52 kind = ShapeBounding;
53 }
54 else if (cuse)
55 {
56 width_ = cw;
57 height_ = ch;
58 xoffs_ = cx;
59 yoffs_ = cy;
60 kind = ShapeClip;
61 }
62 else
63 {
64 LOG_ERROR(logger) << "XShapeQueryExtend returned no extents";
65 return;
66 }
67
68 int rect_count, rect_order;
69 std::unique_ptr<XRectangle[], int(*)(void*)> rectangles(XShapeGetRectangles(dpy, xid, kind, &rect_count, &rect_order), XFree);
70
71 if (!rectangles)
72 {
73 LOG_ERROR(logger) << "Failed to get shape rectangles";
74 return;
75 }
76
77 for (int i = 0; i < rect_count; ++i)
78 rectangles_.push_back(rectangles[i]);
79}
80
81std::vector<XRectangle> const& Shape::GetRectangles() const
82{
83 return rectangles_;
84}
85
86int Shape::Width() const
87{
88 return width_;
89}
90
91int Shape::Height() const
92{
93 return height_;
94}
95
96int Shape::XOffset() const
97{
98 return xoffs_;
99}
100
101int Shape::YOffset() const
102{
103 return yoffs_;
104}
105
106} // decoration namespace
107} // unity namespace
0108
=== added file 'decorations/DecorationsShape.h'
--- decorations/DecorationsShape.h 1970-01-01 00:00:00 +0000
+++ decorations/DecorationsShape.h 2016-08-01 13:05:54 +0000
@@ -0,0 +1,54 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/*
3 * Copyright (C) 2016 Canonical Ltd
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authored by: Eleni Maria Stea <elenimaria.stea@canonical.com>
18 */
19
20#ifndef DECORATIONS_SHAPE_H_
21#define DECORATIONS_SHAPE_H_
22
23#include <X11/Xlib.h>
24#include <vector>
25
26namespace unity
27{
28namespace decoration
29{
30class Shape
31{
32public:
33 Shape(Window);
34
35 int Width() const;
36 int Height() const;
37 int XOffset() const;
38 int YOffset() const;
39
40 std::vector<XRectangle> const& GetRectangles() const;
41
42private:
43 int width_;
44 int height_;
45 int xoffs_;
46 int yoffs_;
47
48 std::vector<XRectangle> rectangles_;
49};
50
51} // decoration namespace
52} // unity namespace
53
54#endif //DECORATIONS_SHAPE_H_
055
=== modified file 'launcher/DeviceNotificationDisplay.h'
--- launcher/DeviceNotificationDisplay.h 2012-08-22 09:03:25 +0000
+++ launcher/DeviceNotificationDisplay.h 2016-08-01 13:05:54 +0000
@@ -36,7 +36,7 @@
3636
37 virtual ~DeviceNotificationDisplay() {}37 virtual ~DeviceNotificationDisplay() {}
3838
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;
40};40};
4141
42}42}
4343
=== modified file 'launcher/DeviceNotificationDisplayImp.cpp'
--- launcher/DeviceNotificationDisplayImp.cpp 2015-04-22 23:54:26 +0000
+++ launcher/DeviceNotificationDisplayImp.cpp 2016-08-01 13:05:54 +0000
@@ -20,49 +20,27 @@
20#include "config.h"20#include "config.h"
21#include <glib/gi18n-lib.h>21#include <glib/gi18n-lib.h>
22#include <libnotify/notify.h>22#include <libnotify/notify.h>
23#include <sigc++/sigc++.h>
24#include <UnityCore/GLibWrapper.h>23#include <UnityCore/GLibWrapper.h>
2524
26#include "DeviceNotificationDisplayImp.h"25#include "DeviceNotificationDisplayImp.h"
27#include "unity-shared/IconLoader.h"
2826
29namespace unity27namespace unity
30{28{
31namespace launcher29namespace launcher
32{30{
3331
34namespace
35{
36const unsigned icon_size = 48;
37}
38
39//32//
40// Start private implementation33// Start private implementation
41//34//
42class DeviceNotificationDisplayImp::Impl35class DeviceNotificationDisplayImp::Impl
43{36{
44public:37public:
45 void Show(std::string const& icon_name, std::string const& volume_name)38 void Show(std::string const& volume_name)
46 {
47 IconLoader::GetDefault().LoadFromGIconString(icon_name, -1, icon_size,
48 sigc::bind(sigc::mem_fun(this, &Impl::ShowNotificationWhenIconIsReady), volume_name));
49 }
50
51 void ShowNotificationWhenIconIsReady(std::string const& icon_name,
52 int max_width,
53 int max_height,
54 glib::Object<GdkPixbuf> const& pixbuf,
55 std::string const& volume_name)
56 {39 {
57 glib::Object<NotifyNotification> notification(notify_notification_new(volume_name.c_str(),40 glib::Object<NotifyNotification> notification(notify_notification_new(volume_name.c_str(),
58 _("The drive has been successfully ejected"),41 _("The drive has been successfully ejected"),
59 nullptr));42 "notification-device-eject"));
60
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));
62
63 if (pixbuf)
64 notify_notification_set_image_from_pixbuf(notification, pixbuf);
65
66 notify_notification_show(notification, nullptr);44 notify_notification_show(notification, nullptr);
67 }45 }
68};46};
@@ -78,9 +56,9 @@
78DeviceNotificationDisplayImp::~DeviceNotificationDisplayImp()56DeviceNotificationDisplayImp::~DeviceNotificationDisplayImp()
79{}57{}
8058
81void DeviceNotificationDisplayImp::Display(std::string const& icon_name, std::string const& volume_name)59void DeviceNotificationDisplayImp::Display(std::string const& volume_name)
82{60{
83 pimpl->Show(icon_name, volume_name);61 pimpl->Show(volume_name);
84}62}
8563
86}64}
8765
=== modified file 'launcher/DeviceNotificationDisplayImp.h'
--- launcher/DeviceNotificationDisplayImp.h 2012-08-22 09:03:25 +0000
+++ launcher/DeviceNotificationDisplayImp.h 2016-08-01 13:05:54 +0000
@@ -33,7 +33,7 @@
33 DeviceNotificationDisplayImp();33 DeviceNotificationDisplayImp();
34 virtual ~DeviceNotificationDisplayImp();34 virtual ~DeviceNotificationDisplayImp();
3535
36 virtual void Display(std::string const& icon_name, std::string const& volume_name);36 virtual void Display(std::string const& volume_name);
3737
38private:38private:
39 class Impl;39 class Impl;
4040
=== modified file 'launcher/FileManagerLauncherIcon.cpp'
--- launcher/FileManagerLauncherIcon.cpp 2016-07-05 10:21:45 +0000
+++ launcher/FileManagerLauncherIcon.cpp 2016-08-01 13:05:54 +0000
@@ -46,6 +46,9 @@
46 // We disconnect from ApplicationLauncherIcon app signals, as we manage them manually46 // We disconnect from ApplicationLauncherIcon app signals, as we manage them manually
47 signals_conn_.Clear();47 signals_conn_.Clear();
4848
49 SetQuirk(Quirk::VISIBLE, false);
50 SkipQuirkAnimation(Quirk::VISIBLE);
51
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) {
50 LOG_DEBUG(logger) << tooltip_text() << " desktop_file now " << desktop_file;53 LOG_DEBUG(logger) << tooltip_text() << " desktop_file now " << desktop_file;
51 UpdateDesktopFile();54 UpdateDesktopFile();
@@ -74,7 +77,6 @@
74 _source_manager.Remove(ICON_REMOVE_TIMEOUT);77 _source_manager.Remove(ICON_REMOVE_TIMEOUT);
75 }));78 }));
7679
77
78 UpdateStorageWindows();80 UpdateStorageWindows();
79}81}
8082
@@ -120,7 +122,7 @@
120122
121 for (auto const& app_win : ApplicationLauncherIcon::GetManagedWindows())123 for (auto const& app_win : ApplicationLauncherIcon::GetManagedWindows())
122 {124 {
123 if (IsLocationManaged(file_manager_->LocationForWindow(app_win)))125 if (WindowManager::Default().IsWindowMapped(app_win->window_id()) && IsLocationManaged(file_manager_->LocationForWindow(app_win)))
124 fm_windows.push_back(app_win);126 fm_windows.push_back(app_win);
125 }127 }
126128
127129
=== modified file 'launcher/TrashLauncherIcon.cpp'
--- launcher/TrashLauncherIcon.cpp 2015-12-11 15:15:47 +0000
+++ launcher/TrashLauncherIcon.cpp 2016-08-01 13:05:54 +0000
@@ -55,23 +55,27 @@
55 SkipQuirkAnimation(Quirk::VISIBLE);55 SkipQuirkAnimation(Quirk::VISIBLE);
56 SetShortcut('t');56 SetShortcut('t');
5757
58 glib::Object<GFile> location(g_file_new_for_uri(TRASH_URI.c_str()));58 _source_manager.AddIdle([this]{
5959 glib::Object<GFile> location(g_file_new_for_uri(TRASH_URI.c_str()));
60 glib::Error err;60
61 trash_monitor_ = g_file_monitor_directory(location, G_FILE_MONITOR_NONE, cancellable_, &err);61 glib::Error err;
62 g_file_monitor_set_rate_limit(trash_monitor_, 1000);62 trash_monitor_ = g_file_monitor_directory(location, G_FILE_MONITOR_NONE, cancellable_, &err);
6363 g_file_monitor_set_rate_limit(trash_monitor_, 1000);
64 if (err)64
65 {65 if (err)
66 LOG_ERROR(logger) << "Could not create file monitor for trash uri: " << err;66 {
67 }67 LOG_ERROR(logger) << "Could not create file monitor for trash uri: " << err;
68 else68 }
69 {69 else
70 glib_signals_.Add<void, GFileMonitor*, GFile*, GFile*, GFileMonitorEvent>(trash_monitor_, "changed",70 {
71 [this] (GFileMonitor*, GFile*, GFile*, GFileMonitorEvent) {71 glib_signals_.Add<void, GFileMonitor*, GFile*, GFile*, GFileMonitorEvent>(trash_monitor_, "changed",
72 UpdateTrashIcon();72 [this] (GFileMonitor*, GFile*, GFile*, GFileMonitorEvent) {
73 });73 UpdateTrashIcon();
74 }74 });
75 }
76
77 return false;
78 });
7579
76 UpdateTrashIcon();80 UpdateTrashIcon();
77 UpdateStorageWindows();81 UpdateStorageWindows();
7882
=== modified file 'launcher/VolumeLauncherIcon.cpp'
--- launcher/VolumeLauncherIcon.cpp 2016-02-25 13:42:10 +0000
+++ launcher/VolumeLauncherIcon.cpp 2016-08-01 13:05:54 +0000
@@ -108,7 +108,7 @@
108108
109 auto conn = std::make_shared<sigc::connection>();109 auto conn = std::make_shared<sigc::connection>();
110 *conn = volume_->ejected.connect([this, conn] {110 *conn = volume_->ejected.connect([this, conn] {
111 notification_->Display(volume_->GetIconName(), volume_->GetName());111 notification_->Display(volume_->GetName());
112 conn->disconnect();112 conn->disconnect();
113 });113 });
114 connections_.Add(*conn);114 connections_.Add(*conn);
115115
=== modified file 'lockscreen/LockScreenAcceleratorController.cpp'
--- lockscreen/LockScreenAcceleratorController.cpp 2016-07-05 10:22:08 +0000
+++ lockscreen/LockScreenAcceleratorController.cpp 2016-08-01 13:05:54 +0000
@@ -194,10 +194,20 @@
194 CompOption::Vector options;194 CompOption::Vector options;
195195
196 if (action.state() & CompAction::StateInitKey)196 if (action.state() & CompAction::StateInitKey)
197 action.initiate()(&action, 0, options);197 {
198 auto const& initiate_cb = action.initiate();
199
200 if (!initiate_cb.empty())
201 initiate_cb(&action, 0, options);
202 }
198203
199 if (action.state() & CompAction::StateTermKey)204 if (action.state() & CompAction::StateTermKey)
200 action.terminate()(&action, CompAction::StateTermTapped, options);205 {
206 auto const& terminate_cb = action.terminate();
207
208 if (!terminate_cb.empty())
209 terminate_cb(&action, CompAction::StateTermTapped, options);
210 }
201}211}
202212
203Accelerators::Ptr const& AcceleratorController::GetAccelerators() const213Accelerators::Ptr const& AcceleratorController::GetAccelerators() const
204214
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2016-07-05 10:22:42 +0000
+++ plugins/unityshell/src/unityshell.cpp 2016-08-01 13:05:54 +0000
@@ -3013,9 +3013,9 @@
3013 wAttrib.opacity = 0.0;3013 wAttrib.opacity = 0.0;
3014 int old_index = gWindow->glPaintGetCurrentIndex();3014 int old_index = gWindow->glPaintGetCurrentIndex();
3015 gWindow->glPaintSetCurrentIndex(MAXSHORT);3015 gWindow->glPaintSetCurrentIndex(MAXSHORT);
3016 deco_win_->Paint(matrix, wAttrib, region, mask);
3016 bool ret = gWindow->glPaint(wAttrib, matrix, region, mask);3017 bool ret = gWindow->glPaint(wAttrib, matrix, region, mask);
3017 gWindow->glPaintSetCurrentIndex(old_index);3018 gWindow->glPaintSetCurrentIndex(old_index);
3018 deco_win_->Paint(matrix, wAttrib, region, mask);
3019 return ret;3019 return ret;
3020 }3020 }
3021 }3021 }
@@ -3357,6 +3357,7 @@
3357 PluginAdapter::Default().UpdateShowDesktopState();3357 PluginAdapter::Default().UpdateShowDesktopState();
3358 break;3358 break;
3359 case CompWindowNotifyBeforeDestroy:3359 case CompWindowNotifyBeforeDestroy:
3360 deco_win_->Undecorate();
3360 being_destroyed.emit();3361 being_destroyed.emit();
3361 break;3362 break;
3362 case CompWindowNotifyMinimize:3363 case CompWindowNotifyMinimize:
33633364
=== modified file 'plugins/unityshell/unityshell.xml.in'
--- plugins/unityshell/unityshell.xml.in 2016-04-05 13:23:27 +0000
+++ plugins/unityshell/unityshell.xml.in 2016-08-01 13:05:54 +0000
@@ -39,6 +39,8 @@
39 <plugin>compiztoolbox</plugin>39 <plugin>compiztoolbox</plugin>
40 <plugin>scale</plugin>40 <plugin>scale</plugin>
41 <plugin>expo</plugin>41 <plugin>expo</plugin>
42 <plugin>move</plugin>
43 <plugin>resize</plugin>
42 </requirement>44 </requirement>
43 <conflict>45 <conflict>
44 <plugin>decor</plugin>46 <plugin>decor</plugin>
4547
=== modified file 'tests/test_mock_devices.h'
--- tests/test_mock_devices.h 2016-01-24 14:35:49 +0000
+++ tests/test_mock_devices.h 2016-08-01 13:05:54 +0000
@@ -101,7 +101,7 @@
101 typedef std::shared_ptr<MockDeviceNotificationDisplay> Ptr;101 typedef std::shared_ptr<MockDeviceNotificationDisplay> Ptr;
102 typedef testing::NiceMock<MockDeviceNotificationDisplay> Nice;102 typedef testing::NiceMock<MockDeviceNotificationDisplay> Nice;
103103
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));
105};105};
106106
107} // anonymous namespace107} // anonymous namespace
108108
=== modified file 'tests/test_unity_window_view.cpp'
--- tests/test_unity_window_view.cpp 2016-03-31 02:03:55 +0000
+++ tests/test_unity_window_view.cpp 2016-08-01 13:05:54 +0000
@@ -82,12 +82,18 @@
82 view.closable = true;82 view.closable = true;
83 ASSERT_NE(view.close_button_, nullptr);83 ASSERT_NE(view.close_button_, nullptr);
8484
85 auto weak_ptr = nux::ObjectWeakPtr<IconTexture>(view.close_button_);
86 ASSERT_TRUE(weak_ptr.IsValid());
87
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));
86 EXPECT_EQ(view.close_button_->GetParentObject(), &view);89 EXPECT_EQ(view.close_button_->GetParentObject(), &view);
8790
88 int padding = view.style()->GetCloseButtonPadding().CP(view.scale);91 int padding = view.style()->GetCloseButtonPadding().CP(view.scale);
89 EXPECT_EQ(view.close_button_->GetBaseX(), padding);92 EXPECT_EQ(view.close_button_->GetBaseX(), padding);
90 EXPECT_EQ(view.close_button_->GetBaseY(), padding);93 EXPECT_EQ(view.close_button_->GetBaseY(), padding);
94
95 view.closable = false;
96 ASSERT_FALSE(weak_ptr.IsValid());
91}97}
9298
93TEST_F(TestUnityWindowView, CloseButtonStates)99TEST_F(TestUnityWindowView, CloseButtonStates)
94100
=== modified file 'tests/test_volume_launcher_icon.cpp'
--- tests/test_volume_launcher_icon.cpp 2016-01-24 14:35:49 +0000
+++ tests/test_volume_launcher_icon.cpp 2016-08-01 13:05:54 +0000
@@ -481,7 +481,7 @@
481 auto menuitem = GetMenuItemAtIndex(5);481 auto menuitem = GetMenuItemAtIndex(5);
482482
483 EXPECT_CALL(*volume_, Eject());483 EXPECT_CALL(*volume_, Eject());
484 EXPECT_CALL(*notifications_, Display(volume_->GetIconName(), volume_->GetName()));484 EXPECT_CALL(*notifications_, Display(volume_->GetName()));
485485
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");
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));
@@ -573,7 +573,7 @@
573 .WillRepeatedly(Return(true));573 .WillRepeatedly(Return(true));
574574
575 EXPECT_CALL(*volume_, Eject());575 EXPECT_CALL(*volume_, Eject());
576 EXPECT_CALL(*notifications_, Display(volume_->GetIconName(), volume_->GetName()));576 EXPECT_CALL(*notifications_, Display(volume_->GetName()));
577 icon_->EjectAndShowNotification();577 icon_->EjectAndShowNotification();
578}578}
579579
580580
=== modified file 'tools/CMakeLists.txt'
--- tools/CMakeLists.txt 2016-02-09 01:26:22 +0000
+++ tools/CMakeLists.txt 2016-08-01 13:05:54 +0000
@@ -6,3 +6,25 @@
6configure_file (${CMAKE_CURRENT_SOURCE_DIR}/unity.cmake ${CMAKE_BINARY_DIR}/bin/unity)6configure_file (${CMAKE_CURRENT_SOURCE_DIR}/unity.cmake ${CMAKE_BINARY_DIR}/bin/unity)
7install(FILES ${CMAKE_BINARY_DIR}/bin/unity PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ7install(FILES ${CMAKE_BINARY_DIR}/bin/unity PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
8GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_BINDIR})8GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_BINDIR})
9
10#
11# unity-active-plugins-safety-check
12#
13pkg_check_modules(UAPSC_DEPS REQUIRED libcompizconfig)
14
15set(CFLAGS
16 ${UAPSC_DEPS_CFLAGS}
17 ${UAPSC_DEPS_CFLAGS_OTHER}
18 )
19
20string (REPLACE ";" " " CFLAGS "${CFLAGS}")
21set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CFLAGS}")
22
23set(LIBS ${UAPSC_DEPS_LIBRARIES})
24
25set(LIB_PATHS ${UAPSC_DEPS_LIBRARY_DIRS})
26link_directories(${LIB_PATHS})
27
28add_executable(unity-active-plugins-safety-check unity_active_plugins_safety_check.cpp)
29target_link_libraries(unity-active-plugins-safety-check ${LIBS})
30install(TARGETS unity-active-plugins-safety-check DESTINATION ${CMAKE_INSTALL_LIBDIR}/unity/)
931
=== modified file 'tools/unity.cmake'
--- tools/unity.cmake 2016-04-08 18:13:40 +0000
+++ tools/unity.cmake 2016-08-01 13:05:54 +0000
@@ -59,6 +59,12 @@
5959
60 os.environ['COMPIZ_CONFIG_PROFILE'] = 'ubuntu'60 os.environ['COMPIZ_CONFIG_PROFILE'] = 'ubuntu'
6161
62 try:
63 if subprocess.call('/usr/lib/nux/unity_support_test -f'.split()) > 0:
64 os.environ['COMPIZ_CONFIG_PROFILE'] = 'ubuntu-lowgfx'
65 except:
66 pass
67
62 if not 'DISPLAY' in os.environ:68 if not 'DISPLAY' in os.environ:
63 # take an optimistic chance and warn about it :)69 # take an optimistic chance and warn about it :)
64 print("WARNING: no DISPLAY variable set, setting it to :0")70 print("WARNING: no DISPLAY variable set, setting it to :0")
6571
=== added file 'tools/unity_active_plugins_safety_check.cpp'
--- tools/unity_active_plugins_safety_check.cpp 1970-01-01 00:00:00 +0000
+++ tools/unity_active_plugins_safety_check.cpp 2016-08-01 13:05:54 +0000
@@ -0,0 +1,83 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Andrea Azzarone <andrea.azzarone@canonical.com>
17 */
18
19#include <ccs.h>
20#include <gio/gio.h>
21
22#include <iostream>
23#include <string>
24
25extern const CCSInterfaceTable ccsDefaultInterfaceTable;
26
27void PluginSetActiveWithDeps(CCSContext* context, std::string const& plugin_name)
28{
29 if (plugin_name.empty())
30 return;
31
32 auto plugin = ccsFindPlugin(context, plugin_name.c_str());
33
34 if (!plugin)
35 return;
36
37 auto reqs = ccsPluginGetRequiresPlugins(plugin);
38 for (auto req = reqs; req; req = req->next)
39 {
40 if (req->data && req->data->value)
41 {
42 std::string name = req->data->value;
43 PluginSetActiveWithDeps(context, name.c_str());
44 }
45 }
46
47 if (!ccsPluginIsActive(context, plugin_name.c_str())) {
48 std::cout << "Setting plugin '" << plugin_name << "' to active" << std::endl;
49 ccsPluginSetActive(plugin, true);
50 }
51
52 auto conflicts = ccsPluginGetConflictPlugins(plugin);
53 for (auto con = conflicts; con; con = con->next)
54 {
55 if (con->data && con->data->value)
56 {
57 std::string name = con->data->value;
58 auto plugin = ccsFindPlugin(context, name.c_str());
59
60 if (ccsPluginIsActive(context, name.c_str()))
61 {
62 std::cout << "Setting plugin '" << name << "' to non-active" << std::endl;
63 ccsPluginSetActive(plugin, false);
64 }
65 }
66 }
67}
68
69int main()
70{
71 auto context = ccsContextNew (0, &ccsDefaultInterfaceTable);
72
73 if (!context)
74 return -1;
75
76 PluginSetActiveWithDeps(context, "unityshell");
77
78 ccsWriteChangedSettings(context);
79 g_settings_sync();
80 ccsFreeContext(context);
81
82 return 0;
83}
084
=== modified file 'unity-shared/CompizUtils.cpp'
--- unity-shared/CompizUtils.cpp 2015-11-02 14:58:01 +0000
+++ unity-shared/CompizUtils.cpp 2016-08-01 13:05:54 +0000
@@ -211,11 +211,10 @@
211 }211 }
212 }212 }
213213
214 if (region.boundingRect() != win->geometry()) // Shaped windows214 elements |= DecorationElement::SHADOW;
215 return elements;
216215
217 if (rectangular)216 if (!rectangular)
218 elements |= DecorationElement::SHADOW;217 elements |= DecorationElement::SHAPED;
219218
220 if (!win->overrideRedirect() &&219 if (!win->overrideRedirect() &&
221 (win->type() & DECORABLE_WINDOW_TYPES) &&220 (win->type() & DECORABLE_WINDOW_TYPES) &&
222221
=== modified file 'unity-shared/CompizUtils.h'
--- unity-shared/CompizUtils.h 2015-11-02 14:58:01 +0000
+++ unity-shared/CompizUtils.h 2016-08-01 13:05:54 +0000
@@ -133,7 +133,8 @@
133 NONE = 0,133 NONE = 0,
134 EDGE = (1 << 0),134 EDGE = (1 << 0),
135 SHADOW = (1 << 1),135 SHADOW = (1 << 1),
136 BORDER = (1 << 2),136 SHAPED = (1 << 2),
137 BORDER = (1 << 3),
137 FULL = EDGE|SHADOW|BORDER138 FULL = EDGE|SHADOW|BORDER
138};139};
139}140}
140141
=== modified file 'unity-shared/PluginAdapter.cpp'
--- unity-shared/PluginAdapter.cpp 2016-03-18 18:58:26 +0000
+++ unity-shared/PluginAdapter.cpp 2016-08-01 13:05:54 +0000
@@ -630,7 +630,7 @@
630 CompWindow* window = m_Screen->findWindow(window_id);630 CompWindow* window = m_Screen->findWindow(window_id);
631 if (window)631 if (window)
632 return window->mapNum () > 0;632 return window->mapNum () > 0;
633 return true;633 return false;
634}634}
635635
636bool PluginAdapter::IsWindowVisible(Window window_id) const636bool PluginAdapter::IsWindowVisible(Window window_id) const
637637
=== modified file 'unity-shared/TextInput.cpp'
--- unity-shared/TextInput.cpp 2016-03-31 05:57:11 +0000
+++ unity-shared/TextInput.cpp 2016-08-01 13:05:54 +0000
@@ -104,7 +104,6 @@
104 , scale(1.0)104 , scale(1.0)
105 , bg_layer_(new nux::ColorLayer(nux::Color(0xff595853), true))105 , bg_layer_(new nux::ColorLayer(nux::Color(0xff595853), true))
106 , caps_lock_on(false)106 , caps_lock_on(false)
107 , num_lock_on(false)
108 , last_width_(-1)107 , last_width_(-1)
109 , last_height_(-1)108 , last_height_(-1)
110{109{
@@ -146,9 +145,8 @@
146145
147 // Caps lock warning146 // Caps lock warning
148 warning_ = new IconTexture(LoadWarningIcon(DEFAULT_ICON_SIZE.CP(scale)));147 warning_ = new IconTexture(LoadWarningIcon(DEFAULT_ICON_SIZE.CP(scale)));
149 warning_->SetVisible(caps_lock_on() || num_lock_on());148 warning_->SetVisible(caps_lock_on());
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);
151 num_lock_on.changed.connect(sigc::mem_fun(this, &TextInput::OnLockStateChanged));
152 caps_lock_on.changed.connect(sigc::mem_fun(this, &TextInput::OnLockStateChanged));150 caps_lock_on.changed.connect(sigc::mem_fun(this, &TextInput::OnLockStateChanged));
153151
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)));
@@ -249,7 +247,6 @@
249{247{
250 GdkKeymap* keymap = gdk_keymap_get_default();248 GdkKeymap* keymap = gdk_keymap_get_default();
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;
252 num_lock_on = gdk_keymap_get_num_lock_state(keymap) ? true : false;
253}250}
254251
255void TextInput::OnLockStateChanged(bool)252void TextInput::OnLockStateChanged(bool)
@@ -260,8 +257,8 @@
260 return;257 return;
261 }258 }
262259
263 warning_->SetVisible(caps_lock_on() || num_lock_on());260 warning_->SetVisible(caps_lock_on());
264 warning_->SetOpacity((num_lock_on() && !caps_lock_on()) ? 0.3 : 1.0);261 warning_->SetOpacity(1.0);
265 warning_tooltip_.Release();262 warning_tooltip_.Release();
266 QueueRelayout();263 QueueRelayout();
267 QueueDraw();264 QueueDraw();
@@ -345,18 +342,10 @@
345342
346 pango_layout_set_height(layout, -1); //avoid wrap lines343 pango_layout_set_height(layout, -1); //avoid wrap lines
347344
348 if (caps_lock_on() && num_lock_on())345 if (caps_lock_on())
349 {
350 pango_layout_set_text(layout, _("Caps lock and Num lock are on"), -1);
351 }
352 else if (caps_lock_on())
353 {346 {
354 pango_layout_set_text(layout, _("Caps lock is on"), -1);347 pango_layout_set_text(layout, _("Caps lock is on"), -1);
355 }348 }
356 else if (num_lock_on())
357 {
358 pango_layout_set_text(layout, _("Num lock is on"), -1);
359 }
360349
361 nux::Size extents;350 nux::Size extents;
362 pango_layout_get_pixel_size(layout, &extents.width, &extents.height);351 pango_layout_get_pixel_size(layout, &extents.width, &extents.height);
363352
=== modified file 'unity-shared/TextInput.h'
--- unity-shared/TextInput.h 2016-03-31 05:57:11 +0000
+++ unity-shared/TextInput.h 2016-08-01 13:05:54 +0000
@@ -124,7 +124,6 @@
124 SearchBarSpinner* spinner_;124 SearchBarSpinner* spinner_;
125125
126 nux::Property<bool> caps_lock_on;126 nux::Property<bool> caps_lock_on;
127 nux::Property<bool> num_lock_on;
128 int last_width_;127 int last_width_;
129 int last_height_;128 int last_height_;
130129
131130
=== modified file 'unity-shared/UnityWindowView.cpp'
--- unity-shared/UnityWindowView.cpp 2016-07-05 10:22:42 +0000
+++ unity-shared/UnityWindowView.cpp 2016-08-01 13:05:54 +0000
@@ -145,7 +145,12 @@
145{145{
146 if (!closable)146 if (!closable)
147 {147 {
148 close_button_ = nullptr;148 if (close_button_)
149 {
150 close_button_->UnParentObject();
151 close_button_ = nullptr;
152 }
153
149 return;154 return;
150 }155 }
151156
152157
=== renamed file 'debian/unity7.conf' => 'unity7.conf.in'
--- debian/unity7.conf 2016-07-05 10:22:49 +0000
+++ unity7.conf.in 2016-08-01 13:05:54 +0000
@@ -21,6 +21,9 @@
2121
22 echo "Using compiz profile '$compiz_profile'"22 echo "Using compiz profile '$compiz_profile'"
23 initctl set-env -g COMPIZ_CONFIG_PROFILE="$compiz_profile"23 initctl set-env -g COMPIZ_CONFIG_PROFILE="$compiz_profile"
24 export COMPIZ_CONFIG_PROFILE="$compiz_profile"
25
26 ${CMAKE_INSTALL_FULL_LIBDIR}/unity/unity-active-plugins-safety-check
24end script27end script
2528
26respawn29respawn

Subscribers

People subscribed via source and target branches

to all changes: