Merge lp:~3v1n0/unity/gtk-border-radius-support into lp:unity
- gtk-border-radius-support
- Merge into trunk
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 | ||||
Related bugs: |
|
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
This requires lp:~3v1n0/gtk/unity-border-radius-support/+merge/288331
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 : | # |
PASSED: Continuous integration, rev:3995
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
review:
Approve
(continuous-integration)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'decorations/DecoratedWindow.cpp' | |||
2 | --- decorations/DecoratedWindow.cpp 2015-08-07 18:54:07 +0000 | |||
3 | +++ decorations/DecoratedWindow.cpp 2016-03-09 17:31:58 +0000 | |||
4 | @@ -47,6 +47,7 @@ | |||
5 | 47 | , monitor_(0) | 47 | , monitor_(0) |
6 | 48 | , dirty_geo_(true) | 48 | , dirty_geo_(true) |
7 | 49 | , dirty_frame_(false) | 49 | , dirty_frame_(false) |
8 | 50 | , client_decorated_(false) | ||
9 | 50 | , deco_elements_(cu::DecorationElement::NONE) | 51 | , deco_elements_(cu::DecorationElement::NONE) |
10 | 51 | , last_mwm_decor_(win_->mwmDecor()) | 52 | , last_mwm_decor_(win_->mwmDecor()) |
11 | 52 | , last_actions_(win_->actions()) | 53 | , last_actions_(win_->actions()) |
12 | @@ -105,7 +106,8 @@ | |||
13 | 105 | 106 | ||
14 | 106 | void Window::Impl::Update() | 107 | void Window::Impl::Update() |
15 | 107 | { | 108 | { |
17 | 108 | UpdateElements(); | 109 | UpdateClientDecorationsState(); |
18 | 110 | UpdateElements(client_decorated_ ? cu::WindowFilter::CLIENTSIDE_DECORATED : cu::WindowFilter::NONE); | ||
19 | 109 | 111 | ||
20 | 110 | if (deco_elements_ & (cu::DecorationElement::EDGE | cu::DecorationElement::BORDER)) | 112 | if (deco_elements_ & (cu::DecorationElement::EDGE | cu::DecorationElement::BORDER)) |
21 | 111 | Decorate(); | 113 | Decorate(); |
22 | @@ -212,10 +214,10 @@ | |||
23 | 212 | if (win_->shaded()) | 214 | if (win_->shaded()) |
24 | 213 | frame_geo.height = input.top + input.bottom; | 215 | frame_geo.height = input.top + input.bottom; |
25 | 214 | 216 | ||
27 | 215 | if (!frame_) | 217 | if (!frame_ && win_->frame()) |
28 | 216 | CreateFrame(frame_geo); | 218 | CreateFrame(frame_geo); |
29 | 217 | 219 | ||
31 | 218 | if (frame_geo_ != frame_geo) | 220 | if (frame_ && frame_geo_ != frame_geo) |
32 | 219 | UpdateFrameGeo(frame_geo); | 221 | UpdateFrameGeo(frame_geo); |
33 | 220 | } | 222 | } |
34 | 221 | 223 | ||
35 | @@ -431,7 +433,7 @@ | |||
36 | 431 | return (win_->state() & MAXIMIZE_STATE) == MAXIMIZE_STATE; | 433 | return (win_->state() & MAXIMIZE_STATE) == MAXIMIZE_STATE; |
37 | 432 | } | 434 | } |
38 | 433 | 435 | ||
40 | 434 | void Window::Impl::UpdateElements(cu::WindowFilter::Value wf) | 436 | void Window::Impl::UpdateElements(cu::WindowFilter wf) |
41 | 435 | { | 437 | { |
42 | 436 | if (!parent_->scaled() && IsMaximized()) | 438 | if (!parent_->scaled() && IsMaximized()) |
43 | 437 | { | 439 | { |
44 | @@ -442,6 +444,31 @@ | |||
45 | 442 | deco_elements_ = cu::WindowDecorationElements(win_, wf); | 444 | deco_elements_ = cu::WindowDecorationElements(win_, wf); |
46 | 443 | } | 445 | } |
47 | 444 | 446 | ||
48 | 447 | void Window::Impl::UpdateClientDecorationsState() | ||
49 | 448 | { | ||
50 | 449 | if (win_->alpha()) | ||
51 | 450 | { | ||
52 | 451 | auto const& corners = WindowManager::Default().GetCardinalProperty(win_->id(), atom::_UNITY_GTK_BORDER_RADIUS); | ||
53 | 452 | |||
54 | 453 | if (!corners.empty()) | ||
55 | 454 | { | ||
56 | 455 | enum Corner { TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT }; | ||
57 | 456 | client_borders_.top = std::max(corners[TOP_LEFT], corners[TOP_RIGHT]); | ||
58 | 457 | client_borders_.left = std::max(corners[TOP_LEFT], corners[BOTTOM_LEFT]); | ||
59 | 458 | client_borders_.right = std::max(corners[TOP_RIGHT], corners[BOTTOM_RIGHT]); | ||
60 | 459 | client_borders_.bottom = std::max(corners[BOTTOM_LEFT], corners[BOTTOM_RIGHT]); | ||
61 | 460 | client_decorated_ = true; | ||
62 | 461 | return; | ||
63 | 462 | } | ||
64 | 463 | } | ||
65 | 464 | |||
66 | 465 | if (client_decorated_) | ||
67 | 466 | { | ||
68 | 467 | client_borders_ = CompWindowExtents(); | ||
69 | 468 | client_decorated_ = false; | ||
70 | 469 | } | ||
71 | 470 | } | ||
72 | 471 | |||
73 | 445 | bool Window::Impl::ShadowDecorated() const | 472 | bool Window::Impl::ShadowDecorated() const |
74 | 446 | { | 473 | { |
75 | 447 | return deco_elements_ & cu::DecorationElement::SHADOW; | 474 | return deco_elements_ & cu::DecorationElement::SHADOW; |
76 | @@ -613,7 +640,14 @@ | |||
77 | 613 | 640 | ||
78 | 614 | if (shadows_rect != last_shadow_rect_) | 641 | if (shadows_rect != last_shadow_rect_) |
79 | 615 | { | 642 | { |
81 | 616 | auto const& win_region = win_->region(); | 643 | auto win_region = win_->region(); |
82 | 644 | |||
83 | 645 | if (client_decorated_) | ||
84 | 646 | { | ||
85 | 647 | win_region.shrink(client_borders_.left + client_borders_.right, client_borders_.top + client_borders_.bottom); | ||
86 | 648 | win_region.translate(client_borders_.left - client_borders_.right, client_borders_.top - client_borders_.bottom); | ||
87 | 649 | } | ||
88 | 650 | |||
89 | 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; |
90 | 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; |
91 | 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; |
92 | @@ -657,6 +691,9 @@ | |||
93 | 657 | auto const& clip_region = (mask & PAINT_WINDOW_TRANSFORMED_MASK) ? infiniteRegion : region; | 691 | auto const& clip_region = (mask & PAINT_WINDOW_TRANSFORMED_MASK) ? infiniteRegion : region; |
94 | 658 | mask |= PAINT_WINDOW_BLEND_MASK; | 692 | mask |= PAINT_WINDOW_BLEND_MASK; |
95 | 659 | 693 | ||
96 | 694 | if (win_->alpha() || attrib.opacity != OPAQUE) | ||
97 | 695 | mask |= PAINT_WINDOW_TRANSLUCENT_MASK; | ||
98 | 696 | |||
99 | 660 | glwin_->vertexBuffer()->begin(); | 697 | glwin_->vertexBuffer()->begin(); |
100 | 661 | 698 | ||
101 | 662 | for (unsigned i = 0; i < shadow_quads_.size(); ++i) | 699 | for (unsigned i = 0; i < shadow_quads_.size(); ++i) |
102 | 663 | 700 | ||
103 | === modified file 'decorations/DecorationsManager.cpp' | |||
104 | --- decorations/DecorationsManager.cpp 2015-08-07 18:54:07 +0000 | |||
105 | +++ decorations/DecorationsManager.cpp 2016-03-09 17:31:58 +0000 | |||
106 | @@ -31,18 +31,15 @@ | |||
107 | 31 | { | 31 | { |
108 | 32 | Manager* manager_ = nullptr; | 32 | Manager* manager_ = nullptr; |
109 | 33 | 33 | ||
110 | 34 | namespace | ||
111 | 35 | { | ||
112 | 36 | namespace atom | 34 | namespace atom |
113 | 37 | { | 35 | { |
114 | 38 | Atom _NET_REQUEST_FRAME_EXTENTS = 0; | 36 | Atom _NET_REQUEST_FRAME_EXTENTS = 0; |
115 | 39 | Atom _NET_WM_VISIBLE_NAME = 0; | 37 | Atom _NET_WM_VISIBLE_NAME = 0; |
117 | 40 | } | 38 | Atom _UNITY_GTK_BORDER_RADIUS = 0; |
118 | 41 | } | 39 | } |
119 | 42 | 40 | ||
120 | 43 | Manager::Impl::Impl(decoration::Manager* parent, menu::Manager::Ptr const& menu) | 41 | Manager::Impl::Impl(decoration::Manager* parent, menu::Manager::Ptr const& menu) |
123 | 44 | : enable_add_supported_atoms_(true) | 42 | : data_pool_(DataPool::Get()) |
122 | 45 | , data_pool_(DataPool::Get()) | ||
124 | 46 | , menu_manager_(menu) | 43 | , menu_manager_(menu) |
125 | 47 | { | 44 | { |
126 | 48 | if (!manager_) | 45 | if (!manager_) |
127 | @@ -51,6 +48,7 @@ | |||
128 | 51 | Display* dpy = screen->dpy(); | 48 | Display* dpy = screen->dpy(); |
129 | 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); |
130 | 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); |
131 | 51 | atom::_UNITY_GTK_BORDER_RADIUS = XInternAtom(dpy, "_UNITY_GTK_BORDER_RADIUS", False); | ||
132 | 54 | 52 | ||
133 | 55 | auto rebuild_cb = sigc::mem_fun(this, &Impl::OnShadowOptionsChanged); | 53 | auto rebuild_cb = sigc::mem_fun(this, &Impl::OnShadowOptionsChanged); |
134 | 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))); |
135 | @@ -65,12 +63,6 @@ | |||
136 | 65 | SetupIntegratedMenus(); | 63 | SetupIntegratedMenus(); |
137 | 66 | } | 64 | } |
138 | 67 | 65 | ||
139 | 68 | Manager::Impl::~Impl() | ||
140 | 69 | { | ||
141 | 70 | enable_add_supported_atoms_ = false; | ||
142 | 71 | screen->updateSupportedWmHints(); | ||
143 | 72 | } | ||
144 | 73 | |||
145 | 74 | cu::PixmapTexture::Ptr Manager::Impl::BuildShadowTexture(unsigned radius, nux::Color const& color) | 66 | cu::PixmapTexture::Ptr Manager::Impl::BuildShadowTexture(unsigned radius, nux::Color const& color) |
146 | 75 | { | 67 | { |
147 | 76 | int tex_size = radius * 4; | 68 | int tex_size = radius * 4; |
148 | @@ -279,6 +271,10 @@ | |||
149 | 279 | win->title = wm.GetStringProperty(event->xproperty.window, event->xproperty.atom); | 271 | win->title = wm.GetStringProperty(event->xproperty.window, event->xproperty.atom); |
150 | 280 | } | 272 | } |
151 | 281 | } | 273 | } |
152 | 274 | else if (event->xproperty.atom == atom::_UNITY_GTK_BORDER_RADIUS) | ||
153 | 275 | { | ||
154 | 276 | UpdateWindow(event->xproperty.window); | ||
155 | 277 | } | ||
156 | 282 | break; | 278 | break; |
157 | 283 | } | 279 | } |
158 | 284 | case ConfigureNotify: | 280 | case ConfigureNotify: |
159 | @@ -400,8 +396,8 @@ | |||
160 | 400 | 396 | ||
161 | 401 | void Manager::AddSupportedAtoms(std::vector<Atom>& atoms) const | 397 | void Manager::AddSupportedAtoms(std::vector<Atom>& atoms) const |
162 | 402 | { | 398 | { |
165 | 403 | if (impl_->enable_add_supported_atoms_) | 399 | atoms.push_back(atom::_UNITY_GTK_BORDER_RADIUS); |
166 | 404 | atoms.push_back(atom::_NET_REQUEST_FRAME_EXTENTS); | 400 | atoms.push_back(atom::_NET_REQUEST_FRAME_EXTENTS); |
167 | 405 | } | 401 | } |
168 | 406 | 402 | ||
169 | 407 | bool Manager::HandleEventBefore(XEvent* xevent) | 403 | bool Manager::HandleEventBefore(XEvent* xevent) |
170 | 408 | 404 | ||
171 | === modified file 'decorations/DecorationsPriv.h' | |||
172 | --- decorations/DecorationsPriv.h 2015-02-03 09:46:48 +0000 | |||
173 | +++ decorations/DecorationsPriv.h 2016-03-09 17:31:58 +0000 | |||
174 | @@ -50,6 +50,11 @@ | |||
175 | 50 | 50 | ||
176 | 51 | namespace cu = compiz_utils; | 51 | namespace cu = compiz_utils; |
177 | 52 | 52 | ||
178 | 53 | namespace atom | ||
179 | 54 | { | ||
180 | 55 | extern Atom _UNITY_GTK_BORDER_RADIUS; | ||
181 | 56 | } | ||
182 | 57 | |||
183 | 53 | struct Quads | 58 | struct Quads |
184 | 54 | { | 59 | { |
185 | 55 | enum class Pos | 60 | enum class Pos |
186 | @@ -93,7 +98,8 @@ | |||
187 | 93 | private: | 98 | private: |
188 | 94 | void UnsetExtents(); | 99 | void UnsetExtents(); |
189 | 95 | void SetupExtents(); | 100 | void SetupExtents(); |
191 | 96 | void UpdateElements(cu::WindowFilter::Value wf = cu::WindowFilter::NONE); | 101 | void UpdateElements(cu::WindowFilter wf = cu::WindowFilter::NONE); |
192 | 102 | void UpdateClientDecorationsState(); | ||
193 | 97 | void UpdateMonitor(); | 103 | void UpdateMonitor(); |
194 | 98 | void UpdateFrame(); | 104 | void UpdateFrame(); |
195 | 99 | void CreateFrame(nux::Geometry const&); | 105 | void CreateFrame(nux::Geometry const&); |
196 | @@ -132,6 +138,7 @@ | |||
197 | 132 | int monitor_; | 138 | int monitor_; |
198 | 133 | bool dirty_geo_; | 139 | bool dirty_geo_; |
199 | 134 | bool dirty_frame_; | 140 | bool dirty_frame_; |
200 | 141 | bool client_decorated_; | ||
201 | 135 | unsigned deco_elements_; | 142 | unsigned deco_elements_; |
202 | 136 | unsigned last_mwm_decor_; | 143 | unsigned last_mwm_decor_; |
203 | 137 | unsigned last_actions_; | 144 | unsigned last_actions_; |
204 | @@ -140,6 +147,7 @@ | |||
205 | 140 | Quads shadow_quads_; | 147 | Quads shadow_quads_; |
206 | 141 | nux::Geometry frame_geo_; | 148 | nux::Geometry frame_geo_; |
207 | 142 | CompRegion frame_region_; | 149 | CompRegion frame_region_; |
208 | 150 | CompWindowExtents client_borders_; | ||
209 | 143 | connection::Wrapper theme_changed_; | 151 | connection::Wrapper theme_changed_; |
210 | 144 | connection::Wrapper dpi_changed_; | 152 | connection::Wrapper dpi_changed_; |
211 | 145 | connection::Wrapper grab_mouse_changed_; | 153 | connection::Wrapper grab_mouse_changed_; |
212 | @@ -161,7 +169,6 @@ | |||
213 | 161 | struct Manager::Impl : sigc::trackable | 169 | struct Manager::Impl : sigc::trackable |
214 | 162 | { | 170 | { |
215 | 163 | Impl(decoration::Manager*, menu::Manager::Ptr const&); | 171 | Impl(decoration::Manager*, menu::Manager::Ptr const&); |
216 | 164 | ~Impl(); | ||
217 | 165 | 172 | ||
218 | 166 | Window::Ptr HandleWindow(CompWindow* cwin); | 173 | Window::Ptr HandleWindow(CompWindow* cwin); |
219 | 167 | bool HandleEventBefore(XEvent*); | 174 | bool HandleEventBefore(XEvent*); |
220 | @@ -188,8 +195,6 @@ | |||
221 | 188 | friend class Manager; | 195 | friend class Manager; |
222 | 189 | friend struct Window::Impl; | 196 | friend struct Window::Impl; |
223 | 190 | 197 | ||
224 | 191 | bool enable_add_supported_atoms_; | ||
225 | 192 | |||
226 | 193 | DataPool::Ptr data_pool_; | 198 | DataPool::Ptr data_pool_; |
227 | 194 | cu::PixmapTexture::Ptr active_shadow_pixmap_; | 199 | cu::PixmapTexture::Ptr active_shadow_pixmap_; |
228 | 195 | cu::PixmapTexture::Ptr inactive_shadow_pixmap_; | 200 | cu::PixmapTexture::Ptr inactive_shadow_pixmap_; |
229 | 196 | 201 | ||
230 | === modified file 'plugins/unityshell/src/inputremover.cpp' | |||
231 | --- plugins/unityshell/src/inputremover.cpp 2016-01-24 20:12:20 +0000 | |||
232 | +++ plugins/unityshell/src/inputremover.cpp 2016-03-09 17:31:58 +0000 | |||
233 | @@ -88,6 +88,7 @@ | |||
234 | 88 | Window shapeWindow, | 88 | Window shapeWindow, |
235 | 89 | Window propWindow) : | 89 | Window propWindow) : |
236 | 90 | mDpy (dpy), | 90 | mDpy (dpy), |
237 | 91 | mProperty (XInternAtom (mDpy, "_UNITY_SAVED_WINDOW_SHAPE", False)), | ||
238 | 91 | mShapeWindow (shapeWindow), | 92 | mShapeWindow (shapeWindow), |
239 | 92 | mPropWindow (propWindow), | 93 | mPropWindow (propWindow), |
240 | 93 | mShapeMask (0), | 94 | mShapeMask (0), |
241 | @@ -328,7 +329,6 @@ | |||
242 | 328 | int nInput, | 329 | int nInput, |
243 | 329 | int inputOrdering) | 330 | int inputOrdering) |
244 | 330 | { | 331 | { |
245 | 331 | Atom prop = XInternAtom (mDpy, "_UNITY_SAVED_WINDOW_SHAPE", FALSE); | ||
246 | 332 | Atom type = XA_CARDINAL; | 332 | Atom type = XA_CARDINAL; |
247 | 333 | int fmt = 32; | 333 | int fmt = 32; |
248 | 334 | 334 | ||
249 | @@ -365,7 +365,7 @@ | |||
250 | 365 | /* No need to check return code, always returns 0 */ | 365 | /* No need to check return code, always returns 0 */ |
251 | 366 | XChangeProperty(mDpy, | 366 | XChangeProperty(mDpy, |
252 | 367 | mPropWindow, | 367 | mPropWindow, |
254 | 368 | prop, | 368 | mProperty, |
255 | 369 | type, | 369 | type, |
256 | 370 | fmt, | 370 | fmt, |
257 | 371 | PropModeReplace, | 371 | PropModeReplace, |
258 | @@ -381,7 +381,6 @@ | |||
259 | 381 | int *inputOrdering) | 381 | int *inputOrdering) |
260 | 382 | 382 | ||
261 | 383 | { | 383 | { |
262 | 384 | Atom prop = XInternAtom (mDpy, "_UNITY_SAVED_WINDOW_SHAPE", FALSE); | ||
263 | 385 | Atom type = XA_CARDINAL; | 384 | Atom type = XA_CARDINAL; |
264 | 386 | int fmt = 32; | 385 | int fmt = 32; |
265 | 387 | 386 | ||
266 | @@ -399,7 +398,7 @@ | |||
267 | 399 | * long the rest of the property is going to be */ | 398 | * long the rest of the property is going to be */ |
268 | 400 | if (!XGetWindowProperty(mDpy, | 399 | if (!XGetWindowProperty(mDpy, |
269 | 401 | mPropWindow, | 400 | mPropWindow, |
271 | 402 | prop, | 401 | mProperty, |
272 | 403 | 0L, | 402 | 0L, |
273 | 404 | headerLength, | 403 | headerLength, |
274 | 405 | FALSE, | 404 | FALSE, |
275 | @@ -438,7 +437,7 @@ | |||
276 | 438 | 437 | ||
277 | 439 | if (!XGetWindowProperty(mDpy, | 438 | if (!XGetWindowProperty(mDpy, |
278 | 440 | mPropWindow, | 439 | mPropWindow, |
280 | 441 | prop, | 440 | mProperty, |
281 | 442 | 0L, | 441 | 0L, |
282 | 443 | fullLength, | 442 | fullLength, |
283 | 444 | FALSE, | 443 | FALSE, |
284 | @@ -486,9 +485,7 @@ | |||
285 | 486 | void | 485 | void |
286 | 487 | compiz::WindowInputRemover::clearProperty() | 486 | compiz::WindowInputRemover::clearProperty() |
287 | 488 | { | 487 | { |
291 | 489 | Atom prop = XInternAtom (mDpy, "_UNITY_SAVED_WINDOW_SHAPE", FALSE); | 488 | XDeleteProperty(mDpy, mPropWindow, mProperty); |
289 | 490 | |||
290 | 491 | XDeleteProperty(mDpy, mPropWindow, prop); | ||
292 | 492 | } | 489 | } |
293 | 493 | 490 | ||
294 | 494 | bool | 491 | bool |
295 | 495 | 492 | ||
296 | === modified file 'plugins/unityshell/src/inputremover.h' | |||
297 | --- plugins/unityshell/src/inputremover.h 2013-02-25 00:59:23 +0000 | |||
298 | +++ plugins/unityshell/src/inputremover.h 2016-03-09 17:31:58 +0000 | |||
299 | @@ -97,6 +97,7 @@ | |||
300 | 97 | void clearRectangles (); | 97 | void clearRectangles (); |
301 | 98 | 98 | ||
302 | 99 | Display *mDpy; | 99 | Display *mDpy; |
303 | 100 | Atom mProperty; | ||
304 | 100 | Window mShapeWindow; | 101 | Window mShapeWindow; |
305 | 101 | Window mPropWindow; | 102 | Window mPropWindow; |
306 | 102 | unsigned long mShapeMask; | 103 | unsigned long mShapeMask; |
307 | 103 | 104 | ||
308 | === modified file 'plugins/unityshell/src/unityshell.cpp' | |||
309 | --- plugins/unityshell/src/unityshell.cpp 2016-01-14 12:35:47 +0000 | |||
310 | +++ plugins/unityshell/src/unityshell.cpp 2016-03-09 17:31:58 +0000 | |||
311 | @@ -175,6 +175,13 @@ | |||
312 | 175 | const std::string FIRST_RUN_STAMP = "first_run.stamp"; | 175 | const std::string FIRST_RUN_STAMP = "first_run.stamp"; |
313 | 176 | const std::string LOCKED_STAMP = "locked.stamp"; | 176 | const std::string LOCKED_STAMP = "locked.stamp"; |
314 | 177 | } // namespace local | 177 | } // namespace local |
315 | 178 | |||
316 | 179 | namespace atom | ||
317 | 180 | { | ||
318 | 181 | Atom _UNITY_SHELL = 0; | ||
319 | 182 | Atom _UNITY_SAVED_WINDOW_SHAPE = 0; | ||
320 | 183 | } | ||
321 | 184 | |||
322 | 178 | } // anon namespace | 185 | } // anon namespace |
323 | 179 | 186 | ||
324 | 180 | UnityScreen::UnityScreen(CompScreen* screen) | 187 | UnityScreen::UnityScreen(CompScreen* screen) |
325 | @@ -311,6 +318,9 @@ | |||
326 | 311 | CompositeScreenInterface::setHandler(cScreen); | 318 | CompositeScreenInterface::setHandler(cScreen); |
327 | 312 | GLScreenInterface::setHandler(gScreen); | 319 | GLScreenInterface::setHandler(gScreen); |
328 | 313 | ScaleScreenInterface::setHandler(sScreen); | 320 | ScaleScreenInterface::setHandler(sScreen); |
329 | 321 | |||
330 | 322 | atom::_UNITY_SHELL = XInternAtom(screen->dpy(), "_UNITY_SHELL", False); | ||
331 | 323 | atom::_UNITY_SAVED_WINDOW_SHAPE = XInternAtom(screen->dpy(), "_UNITY_SAVED_WINDOW_SHAPE", False); | ||
332 | 314 | screen->updateSupportedWmHints(); | 324 | screen->updateSupportedWmHints(); |
333 | 315 | 325 | ||
334 | 316 | nux::NuxInitialize(0); | 326 | nux::NuxInitialize(0); |
335 | @@ -504,8 +514,10 @@ | |||
336 | 504 | QuicklistManager::Destroy(); | 514 | QuicklistManager::Destroy(); |
337 | 505 | decoration::DataPool::Reset(); | 515 | decoration::DataPool::Reset(); |
338 | 506 | SaveLockStamp(false); | 516 | SaveLockStamp(false); |
339 | 507 | |||
340 | 508 | reset_glib_logging(); | 517 | reset_glib_logging(); |
341 | 518 | |||
342 | 519 | screen->addSupportedAtomsSetEnabled(this, false); | ||
343 | 520 | screen->updateSupportedWmHints(); | ||
344 | 509 | } | 521 | } |
345 | 510 | 522 | ||
346 | 511 | void UnityScreen::InitAltTabNextWindow() | 523 | void UnityScreen::InitAltTabNextWindow() |
347 | @@ -1768,6 +1780,8 @@ | |||
348 | 1768 | void UnityScreen::addSupportedAtoms(std::vector<Atom>& atoms) | 1780 | void UnityScreen::addSupportedAtoms(std::vector<Atom>& atoms) |
349 | 1769 | { | 1781 | { |
350 | 1770 | screen->addSupportedAtoms(atoms); | 1782 | screen->addSupportedAtoms(atoms); |
351 | 1783 | atoms.push_back(atom::_UNITY_SHELL); | ||
352 | 1784 | atoms.push_back(atom::_UNITY_SAVED_WINDOW_SHAPE); | ||
353 | 1771 | deco_manager_->AddSupportedAtoms(atoms); | 1785 | deco_manager_->AddSupportedAtoms(atoms); |
354 | 1772 | } | 1786 | } |
355 | 1773 | 1787 | ||
356 | @@ -3028,9 +3042,8 @@ | |||
357 | 3028 | wAttrib.brightness *= 0.75f; | 3042 | wAttrib.brightness *= 0.75f; |
358 | 3029 | } | 3043 | } |
359 | 3030 | 3044 | ||
360 | 3031 | bool ret = gWindow->glPaint(wAttrib, matrix, region, mask); | ||
361 | 3032 | deco_win_->Paint(matrix, wAttrib, region, mask); | 3045 | deco_win_->Paint(matrix, wAttrib, region, mask); |
363 | 3033 | return ret; | 3046 | return gWindow->glPaint(wAttrib, matrix, region, mask); |
364 | 3034 | } | 3047 | } |
365 | 3035 | 3048 | ||
366 | 3036 | /* handle window painting in an opengl context | 3049 | /* handle window painting in an opengl context |
367 | @@ -3153,8 +3166,8 @@ | |||
368 | 3153 | if (draw_panel_shadow == DrawPanelShadow::BELOW_WINDOW) | 3166 | if (draw_panel_shadow == DrawPanelShadow::BELOW_WINDOW) |
369 | 3154 | uScreen->paintPanelShadow(region); | 3167 | uScreen->paintPanelShadow(region); |
370 | 3155 | 3168 | ||
371 | 3169 | deco_win_->Draw(matrix, attrib, region, mask); | ||
372 | 3156 | bool ret = gWindow->glDraw(matrix, attrib, region, mask); | 3170 | bool ret = gWindow->glDraw(matrix, attrib, region, mask); |
373 | 3157 | deco_win_->Draw(matrix, attrib, region, mask); | ||
374 | 3158 | 3171 | ||
375 | 3159 | if (draw_panel_shadow == DrawPanelShadow::OVER_WINDOW) | 3172 | if (draw_panel_shadow == DrawPanelShadow::OVER_WINDOW) |
376 | 3160 | uScreen->paintPanelShadow(region); | 3173 | uScreen->paintPanelShadow(region); |
377 | @@ -4181,13 +4194,17 @@ | |||
378 | 4181 | int n; | 4194 | int n; |
379 | 4182 | Atom *atoms = XListProperties(d, w, &n); | 4195 | Atom *atoms = XListProperties(d, w, &n); |
380 | 4183 | bool has_inconsistent_shape = false; | 4196 | bool has_inconsistent_shape = false; |
381 | 4184 | static Atom unity_shape_rects_atom = XInternAtom(d, "_UNITY_SAVED_WINDOW_SHAPE", False); | ||
382 | 4185 | 4197 | ||
383 | 4186 | for (int i = 0; i < n; ++i) | 4198 | for (int i = 0; i < n; ++i) |
385 | 4187 | if (atoms[i] == unity_shape_rects_atom) | 4199 | { |
386 | 4200 | if (atoms[i] == atom::_UNITY_SAVED_WINDOW_SHAPE) | ||
387 | 4201 | { | ||
388 | 4188 | has_inconsistent_shape = true; | 4202 | has_inconsistent_shape = true; |
389 | 4203 | break; | ||
390 | 4204 | } | ||
391 | 4205 | } | ||
392 | 4189 | 4206 | ||
394 | 4190 | XFree (atoms); | 4207 | XFree(atoms); |
395 | 4191 | return has_inconsistent_shape; | 4208 | return has_inconsistent_shape; |
396 | 4192 | } | 4209 | } |
397 | 4193 | } | 4210 | } |
398 | 4194 | 4211 | ||
399 | === modified file 'unity-shared/CompizUtils.cpp' | |||
400 | --- unity-shared/CompizUtils.cpp 2015-08-14 18:12:26 +0000 | |||
401 | +++ unity-shared/CompizUtils.cpp 2016-03-09 17:31:58 +0000 | |||
402 | @@ -177,7 +177,7 @@ | |||
403 | 177 | // | 177 | // |
404 | 178 | // | 178 | // |
405 | 179 | 179 | ||
407 | 180 | unsigned WindowDecorationElements(CompWindow* win, WindowFilter::Value wf) | 180 | unsigned WindowDecorationElements(CompWindow* win, WindowFilter wf) |
408 | 181 | { | 181 | { |
409 | 182 | unsigned elements = DecorationElement::NONE; | 182 | unsigned elements = DecorationElement::NONE; |
410 | 183 | 183 | ||
411 | @@ -194,8 +194,22 @@ | |||
412 | 194 | bool rectangular = (region.numRects() == 1); | 194 | bool rectangular = (region.numRects() == 1); |
413 | 195 | bool alpha = win->alpha(); | 195 | bool alpha = win->alpha(); |
414 | 196 | 196 | ||
417 | 197 | if (!rectangular && alpha) // Non-rectangular windows with alpha channel | 197 | if (alpha) |
418 | 198 | return elements; | 198 | { |
419 | 199 | if (wf == WindowFilter::CLIENTSIDE_DECORATED) | ||
420 | 200 | { | ||
421 | 201 | elements = DecorationElement::SHADOW; | ||
422 | 202 | |||
423 | 203 | if (win->actions() & CompWindowActionResizeMask) | ||
424 | 204 | elements |= DecorationElement::EDGE; | ||
425 | 205 | |||
426 | 206 | return elements; | ||
427 | 207 | } | ||
428 | 208 | else if (!rectangular) // Non-rectangular windows with alpha channel | ||
429 | 209 | { | ||
430 | 210 | return elements; | ||
431 | 211 | } | ||
432 | 212 | } | ||
433 | 199 | 213 | ||
434 | 200 | if (region.boundingRect() != win->geometry()) // Shaped windows | 214 | if (region.boundingRect() != win->geometry()) // Shaped windows |
435 | 201 | return elements; | 215 | return elements; |
436 | 202 | 216 | ||
437 | === modified file 'unity-shared/CompizUtils.h' | |||
438 | --- unity-shared/CompizUtils.h 2014-10-22 13:58:46 +0000 | |||
439 | +++ unity-shared/CompizUtils.h 2016-03-09 17:31:58 +0000 | |||
440 | @@ -119,14 +119,12 @@ | |||
441 | 119 | cairo_t *cr_; | 119 | cairo_t *cr_; |
442 | 120 | }; | 120 | }; |
443 | 121 | 121 | ||
447 | 122 | namespace WindowFilter | 122 | enum class WindowFilter |
445 | 123 | { | ||
446 | 124 | enum Value | ||
448 | 125 | { | 123 | { |
449 | 126 | NONE, | 124 | NONE, |
451 | 127 | UNMAPPED | 125 | UNMAPPED, |
452 | 126 | CLIENTSIDE_DECORATED | ||
453 | 128 | }; | 127 | }; |
454 | 129 | } | ||
455 | 130 | 128 | ||
456 | 131 | namespace DecorationElement | 129 | namespace DecorationElement |
457 | 132 | { | 130 | { |
458 | @@ -140,7 +138,7 @@ | |||
459 | 140 | }; | 138 | }; |
460 | 141 | } | 139 | } |
461 | 142 | 140 | ||
463 | 143 | unsigned WindowDecorationElements(CompWindow*, WindowFilter::Value wf = WindowFilter::NONE); | 141 | unsigned WindowDecorationElements(CompWindow*, WindowFilter wf = WindowFilter::NONE); |
464 | 144 | 142 | ||
465 | 145 | bool IsWindowEdgeDecorable(CompWindow*); | 143 | bool IsWindowEdgeDecorable(CompWindow*); |
466 | 146 | bool IsWindowShadowDecorable(CompWindow*); | 144 | bool IsWindowShadowDecorable(CompWindow*); |
PASSED: Continuous integration, rev:3992 jenkins. qa.ubuntu. com/job/ unity-ci/ 1423/ jenkins. qa.ubuntu. com/job/ unity-xenial- amd64-ci/ 73 jenkins. qa.ubuntu. com/job/ unity-xenial- armhf-ci/ 73 jenkins. qa.ubuntu. com/job/ unity-xenial- i386-ci/ 73
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- ci/1423/ rebuild
http://