diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-10-01 17:08:56 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-10-01 17:08:56 +0200 |
| commit | fc6a502f9a9eea8f329abddfbcede192101822de (patch) | |
| tree | bf33b5aa0e59c44bc9491379866b93381c4462c8 /unity-shared | |
| parent | 62d634239aa3686f0c8bb6bf277999cfaf00dc2e (diff) | |
CompizUtils: make possible for non-rectangular windows to have edges
But only if they're resizable... Such as Chrome/Chromium when using its client side decorations. (bzr r3806.12.28)
Diffstat (limited to 'unity-shared')
| -rw-r--r-- | unity-shared/CompizUtils.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/unity-shared/CompizUtils.cpp b/unity-shared/CompizUtils.cpp index 29d85bbcd..1ee54baa0 100644 --- a/unity-shared/CompizUtils.cpp +++ b/unity-shared/CompizUtils.cpp @@ -173,7 +173,8 @@ int CairoContext::height() const { return cairo_xlib_surface_get_height(surface_); } -// + +// // unsigned WindowDecorationElements(CompWindow* win) @@ -192,13 +193,18 @@ unsigned WindowDecorationElements(CompWindow* win) if (win->inShowDesktopMode()) return elements; - if (win->region().numRects() != 1) // Non rectangular windows + auto const& region = win->region(); + bool rectangular = (region.numRects() == 1); + bool alpha = win->alpha(); + + if (!rectangular && alpha) // Non-rectangular windows with alpha channel return elements; - if (win->region().boundingRect() != win->geometry()) // Shaped windows + if (region.boundingRect() != win->geometry()) // Shaped windows return elements; - elements |= DecorationElement::SHADOW; + if (rectangular) + elements |= DecorationElement::SHADOW; if (!win->overrideRedirect() && (win->type() & DECORABLE_WINDOW_TYPES) && @@ -207,11 +213,11 @@ unsigned WindowDecorationElements(CompWindow* win) if (win->actions() & CompWindowActionResizeMask) elements |= DecorationElement::EDGE; - if (win->mwmDecor() & (MwmDecorAll | MwmDecorTitle)) + if (rectangular && (win->mwmDecor() & (MwmDecorAll | MwmDecorTitle))) elements |= DecorationElement::BORDER; } - if (!(elements & DecorationElement::BORDER) && win->alpha()) + if (alpha && !(elements & DecorationElement::BORDER)) elements &= ~DecorationElement::SHADOW; return elements; |
