Merge lp:~3v1n0/unity/gtk-border-radius-support into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 4085
Proposed branch: lp:~3v1n0/unity/gtk-border-radius-support
Merge into: lp:unity
Diff against target: 466 lines (+111/-46)
8 files modified
decorations/DecoratedWindow.cpp (+42/-5)
decorations/DecorationsManager.cpp (+9/-13)
decorations/DecorationsPriv.h (+9/-4)
plugins/unityshell/src/inputremover.cpp (+5/-8)
plugins/unityshell/src/inputremover.h (+1/-0)
plugins/unityshell/src/unityshell.cpp (+24/-7)
unity-shared/CompizUtils.cpp (+17/-3)
unity-shared/CompizUtils.h (+4/-6)
To merge this branch: bzr merge lp:~3v1n0/unity/gtk-border-radius-support
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+288358@code.launchpad.net

Commit message

DecoratedWindow: move the shadow under the window if we've a client-side decorated window with corners

Description of the change

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
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 'decorations/DecoratedWindow.cpp'
--- decorations/DecoratedWindow.cpp 2015-08-07 18:54:07 +0000
+++ decorations/DecoratedWindow.cpp 2016-03-09 17:31:58 +0000
@@ -47,6 +47,7 @@
47 , monitor_(0)47 , monitor_(0)
48 , dirty_geo_(true)48 , dirty_geo_(true)
49 , dirty_frame_(false)49 , dirty_frame_(false)
50 , client_decorated_(false)
50 , deco_elements_(cu::DecorationElement::NONE)51 , deco_elements_(cu::DecorationElement::NONE)
51 , last_mwm_decor_(win_->mwmDecor())52 , last_mwm_decor_(win_->mwmDecor())
52 , last_actions_(win_->actions())53 , last_actions_(win_->actions())
@@ -105,7 +106,8 @@
105106
106void Window::Impl::Update()107void Window::Impl::Update()
107{108{
108 UpdateElements();109 UpdateClientDecorationsState();
110 UpdateElements(client_decorated_ ? cu::WindowFilter::CLIENTSIDE_DECORATED : cu::WindowFilter::NONE);
109111
110 if (deco_elements_ & (cu::DecorationElement::EDGE | cu::DecorationElement::BORDER))112 if (deco_elements_ & (cu::DecorationElement::EDGE | cu::DecorationElement::BORDER))
111 Decorate();113 Decorate();
@@ -212,10 +214,10 @@
212 if (win_->shaded())214 if (win_->shaded())
213 frame_geo.height = input.top + input.bottom;215 frame_geo.height = input.top + input.bottom;
214216
215 if (!frame_)217 if (!frame_ && win_->frame())
216 CreateFrame(frame_geo);218 CreateFrame(frame_geo);
217219
218 if (frame_geo_ != frame_geo)220 if (frame_ && frame_geo_ != frame_geo)
219 UpdateFrameGeo(frame_geo);221 UpdateFrameGeo(frame_geo);
220}222}
221223
@@ -431,7 +433,7 @@
431 return (win_->state() & MAXIMIZE_STATE) == MAXIMIZE_STATE;433 return (win_->state() & MAXIMIZE_STATE) == MAXIMIZE_STATE;
432}434}
433435
434void Window::Impl::UpdateElements(cu::WindowFilter::Value wf)436void Window::Impl::UpdateElements(cu::WindowFilter wf)
435{437{
436 if (!parent_->scaled() && IsMaximized())438 if (!parent_->scaled() && IsMaximized())
437 {439 {
@@ -442,6 +444,31 @@
442 deco_elements_ = cu::WindowDecorationElements(win_, wf);444 deco_elements_ = cu::WindowDecorationElements(win_, wf);
443}445}
444446
447void Window::Impl::UpdateClientDecorationsState()
448{
449 if (win_->alpha())
450 {
451 auto const& corners = WindowManager::Default().GetCardinalProperty(win_->id(), atom::_UNITY_GTK_BORDER_RADIUS);
452
453 if (!corners.empty())
454 {
455 enum Corner { TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT };
456 client_borders_.top = std::max(corners[TOP_LEFT], corners[TOP_RIGHT]);
457 client_borders_.left = std::max(corners[TOP_LEFT], corners[BOTTOM_LEFT]);
458 client_borders_.right = std::max(corners[TOP_RIGHT], corners[BOTTOM_RIGHT]);
459 client_borders_.bottom = std::max(corners[BOTTOM_LEFT], corners[BOTTOM_RIGHT]);
460 client_decorated_ = true;
461 return;
462 }
463 }
464
465 if (client_decorated_)
466 {
467 client_borders_ = CompWindowExtents();
468 client_decorated_ = false;
469 }
470}
471
445bool Window::Impl::ShadowDecorated() const472bool Window::Impl::ShadowDecorated() const
446{473{
447 return deco_elements_ & cu::DecorationElement::SHADOW;474 return deco_elements_ & cu::DecorationElement::SHADOW;
@@ -613,7 +640,14 @@
613640
614 if (shadows_rect != last_shadow_rect_)641 if (shadows_rect != last_shadow_rect_)
615 {642 {
616 auto const& win_region = win_->region();643 auto win_region = win_->region();
644
645 if (client_decorated_)
646 {
647 win_region.shrink(client_borders_.left + client_borders_.right, client_borders_.top + client_borders_.bottom);
648 win_region.translate(client_borders_.left - client_borders_.right, client_borders_.top - client_borders_.bottom);
649 }
650
617 quads[Quads::Pos::TOP_LEFT].region = CompRegion(quads[Quads::Pos::TOP_LEFT].box) - win_region;651 quads[Quads::Pos::TOP_LEFT].region = CompRegion(quads[Quads::Pos::TOP_LEFT].box) - win_region;
618 quads[Quads::Pos::TOP_RIGHT].region = CompRegion(quads[Quads::Pos::TOP_RIGHT].box) - win_region;652 quads[Quads::Pos::TOP_RIGHT].region = CompRegion(quads[Quads::Pos::TOP_RIGHT].box) - win_region;
619 quads[Quads::Pos::BOTTOM_LEFT].region = CompRegion(quads[Quads::Pos::BOTTOM_LEFT].box) - win_region;653 quads[Quads::Pos::BOTTOM_LEFT].region = CompRegion(quads[Quads::Pos::BOTTOM_LEFT].box) - win_region;
@@ -657,6 +691,9 @@
657 auto const& clip_region = (mask & PAINT_WINDOW_TRANSFORMED_MASK) ? infiniteRegion : region;691 auto const& clip_region = (mask & PAINT_WINDOW_TRANSFORMED_MASK) ? infiniteRegion : region;
658 mask |= PAINT_WINDOW_BLEND_MASK;692 mask |= PAINT_WINDOW_BLEND_MASK;
659693
694 if (win_->alpha() || attrib.opacity != OPAQUE)
695 mask |= PAINT_WINDOW_TRANSLUCENT_MASK;
696
660 glwin_->vertexBuffer()->begin();697 glwin_->vertexBuffer()->begin();
661698
662 for (unsigned i = 0; i < shadow_quads_.size(); ++i)699 for (unsigned i = 0; i < shadow_quads_.size(); ++i)
663700
=== modified file 'decorations/DecorationsManager.cpp'
--- decorations/DecorationsManager.cpp 2015-08-07 18:54:07 +0000
+++ decorations/DecorationsManager.cpp 2016-03-09 17:31:58 +0000
@@ -31,18 +31,15 @@
31{31{
32Manager* manager_ = nullptr;32Manager* manager_ = nullptr;
3333
34namespace
35{
36namespace atom34namespace atom
37{35{
38Atom _NET_REQUEST_FRAME_EXTENTS = 0;36Atom _NET_REQUEST_FRAME_EXTENTS = 0;
39Atom _NET_WM_VISIBLE_NAME = 0;37Atom _NET_WM_VISIBLE_NAME = 0;
40}38Atom _UNITY_GTK_BORDER_RADIUS = 0;
41}39}
4240
43Manager::Impl::Impl(decoration::Manager* parent, menu::Manager::Ptr const& menu)41Manager::Impl::Impl(decoration::Manager* parent, menu::Manager::Ptr const& menu)
44 : enable_add_supported_atoms_(true)42 : data_pool_(DataPool::Get())
45 , data_pool_(DataPool::Get())
46 , menu_manager_(menu)43 , menu_manager_(menu)
47{44{
48 if (!manager_)45 if (!manager_)
@@ -51,6 +48,7 @@
51 Display* dpy = screen->dpy();48 Display* dpy = screen->dpy();
52 atom::_NET_REQUEST_FRAME_EXTENTS = XInternAtom(dpy, "_NET_REQUEST_FRAME_EXTENTS", False);49 atom::_NET_REQUEST_FRAME_EXTENTS = XInternAtom(dpy, "_NET_REQUEST_FRAME_EXTENTS", False);
53 atom::_NET_WM_VISIBLE_NAME = XInternAtom(dpy, "_NET_WM_VISIBLE_NAME", False);50 atom::_NET_WM_VISIBLE_NAME = XInternAtom(dpy, "_NET_WM_VISIBLE_NAME", False);
51 atom::_UNITY_GTK_BORDER_RADIUS = XInternAtom(dpy, "_UNITY_GTK_BORDER_RADIUS", False);
5452
55 auto rebuild_cb = sigc::mem_fun(this, &Impl::OnShadowOptionsChanged);53 auto rebuild_cb = sigc::mem_fun(this, &Impl::OnShadowOptionsChanged);
56 manager_->active_shadow_color.changed.connect(sigc::hide(sigc::bind(rebuild_cb, true)));54 manager_->active_shadow_color.changed.connect(sigc::hide(sigc::bind(rebuild_cb, true)));
@@ -65,12 +63,6 @@
65 SetupIntegratedMenus();63 SetupIntegratedMenus();
66}64}
6765
68Manager::Impl::~Impl()
69{
70 enable_add_supported_atoms_ = false;
71 screen->updateSupportedWmHints();
72}
73
74cu::PixmapTexture::Ptr Manager::Impl::BuildShadowTexture(unsigned radius, nux::Color const& color)66cu::PixmapTexture::Ptr Manager::Impl::BuildShadowTexture(unsigned radius, nux::Color const& color)
75{67{
76 int tex_size = radius * 4;68 int tex_size = radius * 4;
@@ -279,6 +271,10 @@
279 win->title = wm.GetStringProperty(event->xproperty.window, event->xproperty.atom);271 win->title = wm.GetStringProperty(event->xproperty.window, event->xproperty.atom);
280 }272 }
281 }273 }
274 else if (event->xproperty.atom == atom::_UNITY_GTK_BORDER_RADIUS)
275 {
276 UpdateWindow(event->xproperty.window);
277 }
282 break;278 break;
283 }279 }
284 case ConfigureNotify:280 case ConfigureNotify:
@@ -400,8 +396,8 @@
400396
401void Manager::AddSupportedAtoms(std::vector<Atom>& atoms) const397void Manager::AddSupportedAtoms(std::vector<Atom>& atoms) const
402{398{
403 if (impl_->enable_add_supported_atoms_)399 atoms.push_back(atom::_UNITY_GTK_BORDER_RADIUS);
404 atoms.push_back(atom::_NET_REQUEST_FRAME_EXTENTS);400 atoms.push_back(atom::_NET_REQUEST_FRAME_EXTENTS);
405}401}
406402
407bool Manager::HandleEventBefore(XEvent* xevent)403bool Manager::HandleEventBefore(XEvent* xevent)
408404
=== modified file 'decorations/DecorationsPriv.h'
--- decorations/DecorationsPriv.h 2015-02-03 09:46:48 +0000
+++ decorations/DecorationsPriv.h 2016-03-09 17:31:58 +0000
@@ -50,6 +50,11 @@
5050
51namespace cu = compiz_utils;51namespace cu = compiz_utils;
5252
53namespace atom
54{
55extern Atom _UNITY_GTK_BORDER_RADIUS;
56}
57
53struct Quads58struct Quads
54{59{
55 enum class Pos60 enum class Pos
@@ -93,7 +98,8 @@
93private:98private:
94 void UnsetExtents();99 void UnsetExtents();
95 void SetupExtents();100 void SetupExtents();
96 void UpdateElements(cu::WindowFilter::Value wf = cu::WindowFilter::NONE);101 void UpdateElements(cu::WindowFilter wf = cu::WindowFilter::NONE);
102 void UpdateClientDecorationsState();
97 void UpdateMonitor();103 void UpdateMonitor();
98 void UpdateFrame();104 void UpdateFrame();
99 void CreateFrame(nux::Geometry const&);105 void CreateFrame(nux::Geometry const&);
@@ -132,6 +138,7 @@
132 int monitor_;138 int monitor_;
133 bool dirty_geo_;139 bool dirty_geo_;
134 bool dirty_frame_;140 bool dirty_frame_;
141 bool client_decorated_;
135 unsigned deco_elements_;142 unsigned deco_elements_;
136 unsigned last_mwm_decor_;143 unsigned last_mwm_decor_;
137 unsigned last_actions_;144 unsigned last_actions_;
@@ -140,6 +147,7 @@
140 Quads shadow_quads_;147 Quads shadow_quads_;
141 nux::Geometry frame_geo_;148 nux::Geometry frame_geo_;
142 CompRegion frame_region_;149 CompRegion frame_region_;
150 CompWindowExtents client_borders_;
143 connection::Wrapper theme_changed_;151 connection::Wrapper theme_changed_;
144 connection::Wrapper dpi_changed_;152 connection::Wrapper dpi_changed_;
145 connection::Wrapper grab_mouse_changed_;153 connection::Wrapper grab_mouse_changed_;
@@ -161,7 +169,6 @@
161struct Manager::Impl : sigc::trackable169struct Manager::Impl : sigc::trackable
162{170{
163 Impl(decoration::Manager*, menu::Manager::Ptr const&);171 Impl(decoration::Manager*, menu::Manager::Ptr const&);
164 ~Impl();
165172
166 Window::Ptr HandleWindow(CompWindow* cwin);173 Window::Ptr HandleWindow(CompWindow* cwin);
167 bool HandleEventBefore(XEvent*);174 bool HandleEventBefore(XEvent*);
@@ -188,8 +195,6 @@
188 friend class Manager;195 friend class Manager;
189 friend struct Window::Impl;196 friend struct Window::Impl;
190197
191 bool enable_add_supported_atoms_;
192
193 DataPool::Ptr data_pool_;198 DataPool::Ptr data_pool_;
194 cu::PixmapTexture::Ptr active_shadow_pixmap_;199 cu::PixmapTexture::Ptr active_shadow_pixmap_;
195 cu::PixmapTexture::Ptr inactive_shadow_pixmap_;200 cu::PixmapTexture::Ptr inactive_shadow_pixmap_;
196201
=== modified file 'plugins/unityshell/src/inputremover.cpp'
--- plugins/unityshell/src/inputremover.cpp 2016-01-24 20:12:20 +0000
+++ plugins/unityshell/src/inputremover.cpp 2016-03-09 17:31:58 +0000
@@ -88,6 +88,7 @@
88 Window shapeWindow,88 Window shapeWindow,
89 Window propWindow) :89 Window propWindow) :
90 mDpy (dpy),90 mDpy (dpy),
91 mProperty (XInternAtom (mDpy, "_UNITY_SAVED_WINDOW_SHAPE", False)),
91 mShapeWindow (shapeWindow),92 mShapeWindow (shapeWindow),
92 mPropWindow (propWindow),93 mPropWindow (propWindow),
93 mShapeMask (0),94 mShapeMask (0),
@@ -328,7 +329,6 @@
328 int nInput,329 int nInput,
329 int inputOrdering)330 int inputOrdering)
330{331{
331 Atom prop = XInternAtom (mDpy, "_UNITY_SAVED_WINDOW_SHAPE", FALSE);
332 Atom type = XA_CARDINAL;332 Atom type = XA_CARDINAL;
333 int fmt = 32;333 int fmt = 32;
334334
@@ -365,7 +365,7 @@
365 /* No need to check return code, always returns 0 */365 /* No need to check return code, always returns 0 */
366 XChangeProperty(mDpy,366 XChangeProperty(mDpy,
367 mPropWindow,367 mPropWindow,
368 prop,368 mProperty,
369 type,369 type,
370 fmt,370 fmt,
371 PropModeReplace,371 PropModeReplace,
@@ -381,7 +381,6 @@
381 int *inputOrdering)381 int *inputOrdering)
382382
383{383{
384 Atom prop = XInternAtom (mDpy, "_UNITY_SAVED_WINDOW_SHAPE", FALSE);
385 Atom type = XA_CARDINAL;384 Atom type = XA_CARDINAL;
386 int fmt = 32;385 int fmt = 32;
387386
@@ -399,7 +398,7 @@
399 * long the rest of the property is going to be */398 * long the rest of the property is going to be */
400 if (!XGetWindowProperty(mDpy,399 if (!XGetWindowProperty(mDpy,
401 mPropWindow,400 mPropWindow,
402 prop,401 mProperty,
403 0L,402 0L,
404 headerLength,403 headerLength,
405 FALSE,404 FALSE,
@@ -438,7 +437,7 @@
438437
439 if (!XGetWindowProperty(mDpy,438 if (!XGetWindowProperty(mDpy,
440 mPropWindow,439 mPropWindow,
441 prop,440 mProperty,
442 0L,441 0L,
443 fullLength,442 fullLength,
444 FALSE,443 FALSE,
@@ -486,9 +485,7 @@
486void485void
487compiz::WindowInputRemover::clearProperty()486compiz::WindowInputRemover::clearProperty()
488{487{
489 Atom prop = XInternAtom (mDpy, "_UNITY_SAVED_WINDOW_SHAPE", FALSE);488 XDeleteProperty(mDpy, mPropWindow, mProperty);
490
491 XDeleteProperty(mDpy, mPropWindow, prop);
492}489}
493490
494bool491bool
495492
=== modified file 'plugins/unityshell/src/inputremover.h'
--- plugins/unityshell/src/inputremover.h 2013-02-25 00:59:23 +0000
+++ plugins/unityshell/src/inputremover.h 2016-03-09 17:31:58 +0000
@@ -97,6 +97,7 @@
97 void clearRectangles ();97 void clearRectangles ();
9898
99 Display *mDpy;99 Display *mDpy;
100 Atom mProperty;
100 Window mShapeWindow;101 Window mShapeWindow;
101 Window mPropWindow;102 Window mPropWindow;
102 unsigned long mShapeMask;103 unsigned long mShapeMask;
103104
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2016-01-14 12:35:47 +0000
+++ plugins/unityshell/src/unityshell.cpp 2016-03-09 17:31:58 +0000
@@ -175,6 +175,13 @@
175const std::string FIRST_RUN_STAMP = "first_run.stamp";175const std::string FIRST_RUN_STAMP = "first_run.stamp";
176const std::string LOCKED_STAMP = "locked.stamp";176const std::string LOCKED_STAMP = "locked.stamp";
177} // namespace local177} // namespace local
178
179namespace atom
180{
181Atom _UNITY_SHELL = 0;
182Atom _UNITY_SAVED_WINDOW_SHAPE = 0;
183}
184
178} // anon namespace185} // anon namespace
179186
180UnityScreen::UnityScreen(CompScreen* screen)187UnityScreen::UnityScreen(CompScreen* screen)
@@ -311,6 +318,9 @@
311 CompositeScreenInterface::setHandler(cScreen);318 CompositeScreenInterface::setHandler(cScreen);
312 GLScreenInterface::setHandler(gScreen);319 GLScreenInterface::setHandler(gScreen);
313 ScaleScreenInterface::setHandler(sScreen);320 ScaleScreenInterface::setHandler(sScreen);
321
322 atom::_UNITY_SHELL = XInternAtom(screen->dpy(), "_UNITY_SHELL", False);
323 atom::_UNITY_SAVED_WINDOW_SHAPE = XInternAtom(screen->dpy(), "_UNITY_SAVED_WINDOW_SHAPE", False);
314 screen->updateSupportedWmHints();324 screen->updateSupportedWmHints();
315325
316 nux::NuxInitialize(0);326 nux::NuxInitialize(0);
@@ -504,8 +514,10 @@
504 QuicklistManager::Destroy();514 QuicklistManager::Destroy();
505 decoration::DataPool::Reset();515 decoration::DataPool::Reset();
506 SaveLockStamp(false);516 SaveLockStamp(false);
507
508 reset_glib_logging();517 reset_glib_logging();
518
519 screen->addSupportedAtomsSetEnabled(this, false);
520 screen->updateSupportedWmHints();
509}521}
510522
511void UnityScreen::InitAltTabNextWindow()523void UnityScreen::InitAltTabNextWindow()
@@ -1768,6 +1780,8 @@
1768void UnityScreen::addSupportedAtoms(std::vector<Atom>& atoms)1780void UnityScreen::addSupportedAtoms(std::vector<Atom>& atoms)
1769{1781{
1770 screen->addSupportedAtoms(atoms);1782 screen->addSupportedAtoms(atoms);
1783 atoms.push_back(atom::_UNITY_SHELL);
1784 atoms.push_back(atom::_UNITY_SAVED_WINDOW_SHAPE);
1771 deco_manager_->AddSupportedAtoms(atoms);1785 deco_manager_->AddSupportedAtoms(atoms);
1772}1786}
17731787
@@ -3028,9 +3042,8 @@
3028 wAttrib.brightness *= 0.75f;3042 wAttrib.brightness *= 0.75f;
3029 }3043 }
30303044
3031 bool ret = gWindow->glPaint(wAttrib, matrix, region, mask);
3032 deco_win_->Paint(matrix, wAttrib, region, mask);3045 deco_win_->Paint(matrix, wAttrib, region, mask);
3033 return ret;3046 return gWindow->glPaint(wAttrib, matrix, region, mask);
3034}3047}
30353048
3036/* handle window painting in an opengl context3049/* handle window painting in an opengl context
@@ -3153,8 +3166,8 @@
3153 if (draw_panel_shadow == DrawPanelShadow::BELOW_WINDOW)3166 if (draw_panel_shadow == DrawPanelShadow::BELOW_WINDOW)
3154 uScreen->paintPanelShadow(region);3167 uScreen->paintPanelShadow(region);
31553168
3169 deco_win_->Draw(matrix, attrib, region, mask);
3156 bool ret = gWindow->glDraw(matrix, attrib, region, mask);3170 bool ret = gWindow->glDraw(matrix, attrib, region, mask);
3157 deco_win_->Draw(matrix, attrib, region, mask);
31583171
3159 if (draw_panel_shadow == DrawPanelShadow::OVER_WINDOW)3172 if (draw_panel_shadow == DrawPanelShadow::OVER_WINDOW)
3160 uScreen->paintPanelShadow(region);3173 uScreen->paintPanelShadow(region);
@@ -4181,13 +4194,17 @@
4181 int n;4194 int n;
4182 Atom *atoms = XListProperties(d, w, &n);4195 Atom *atoms = XListProperties(d, w, &n);
4183 bool has_inconsistent_shape = false;4196 bool has_inconsistent_shape = false;
4184 static Atom unity_shape_rects_atom = XInternAtom(d, "_UNITY_SAVED_WINDOW_SHAPE", False);
41854197
4186 for (int i = 0; i < n; ++i)4198 for (int i = 0; i < n; ++i)
4187 if (atoms[i] == unity_shape_rects_atom)4199 {
4200 if (atoms[i] == atom::_UNITY_SAVED_WINDOW_SHAPE)
4201 {
4188 has_inconsistent_shape = true;4202 has_inconsistent_shape = true;
4203 break;
4204 }
4205 }
41894206
4190 XFree (atoms);4207 XFree(atoms);
4191 return has_inconsistent_shape;4208 return has_inconsistent_shape;
4192}4209}
4193}4210}
41944211
=== modified file 'unity-shared/CompizUtils.cpp'
--- unity-shared/CompizUtils.cpp 2015-08-14 18:12:26 +0000
+++ unity-shared/CompizUtils.cpp 2016-03-09 17:31:58 +0000
@@ -177,7 +177,7 @@
177//177//
178//178//
179179
180unsigned WindowDecorationElements(CompWindow* win, WindowFilter::Value wf)180unsigned WindowDecorationElements(CompWindow* win, WindowFilter wf)
181{181{
182 unsigned elements = DecorationElement::NONE;182 unsigned elements = DecorationElement::NONE;
183183
@@ -194,8 +194,22 @@
194 bool rectangular = (region.numRects() == 1);194 bool rectangular = (region.numRects() == 1);
195 bool alpha = win->alpha();195 bool alpha = win->alpha();
196196
197 if (!rectangular && alpha) // Non-rectangular windows with alpha channel197 if (alpha)
198 return elements;198 {
199 if (wf == WindowFilter::CLIENTSIDE_DECORATED)
200 {
201 elements = DecorationElement::SHADOW;
202
203 if (win->actions() & CompWindowActionResizeMask)
204 elements |= DecorationElement::EDGE;
205
206 return elements;
207 }
208 else if (!rectangular) // Non-rectangular windows with alpha channel
209 {
210 return elements;
211 }
212 }
199213
200 if (region.boundingRect() != win->geometry()) // Shaped windows214 if (region.boundingRect() != win->geometry()) // Shaped windows
201 return elements;215 return elements;
202216
=== modified file 'unity-shared/CompizUtils.h'
--- unity-shared/CompizUtils.h 2014-10-22 13:58:46 +0000
+++ unity-shared/CompizUtils.h 2016-03-09 17:31:58 +0000
@@ -119,14 +119,12 @@
119 cairo_t *cr_;119 cairo_t *cr_;
120};120};
121121
122namespace WindowFilter122enum class WindowFilter
123{
124enum Value
125{123{
126 NONE,124 NONE,
127 UNMAPPED125 UNMAPPED,
126 CLIENTSIDE_DECORATED
128};127};
129}
130128
131namespace DecorationElement129namespace DecorationElement
132{130{
@@ -140,7 +138,7 @@
140};138};
141}139}
142140
143unsigned WindowDecorationElements(CompWindow*, WindowFilter::Value wf = WindowFilter::NONE);141unsigned WindowDecorationElements(CompWindow*, WindowFilter wf = WindowFilter::NONE);
144142
145bool IsWindowEdgeDecorable(CompWindow*);143bool IsWindowEdgeDecorable(CompWindow*);
146bool IsWindowShadowDecorable(CompWindow*);144bool IsWindowShadowDecorable(CompWindow*);