summaryrefslogtreecommitdiff
path: root/unity-shared
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2014-10-22 09:58:46 -0400
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2014-10-22 09:58:46 -0400
commit586ff1e1f0da39137d1af4813215614d9ef44973 (patch)
tree3fefb8d6e8ac9f317077578da741713ffc6d357b /unity-shared
parent349a6b9030a3643e578858e4c7cbbe0b94bc79d0 (diff)
CompizUtils: allow to filter-out unmapped windows
(bzr r3884.2.1)
Diffstat (limited to 'unity-shared')
-rw-r--r--unity-shared/CompizUtils.cpp6
-rw-r--r--unity-shared/CompizUtils.h16
2 files changed, 17 insertions, 5 deletions
diff --git a/unity-shared/CompizUtils.cpp b/unity-shared/CompizUtils.cpp
index 94322a68f..406343014 100644
--- a/unity-shared/CompizUtils.cpp
+++ b/unity-shared/CompizUtils.cpp
@@ -177,14 +177,14 @@ int CairoContext::height() const
//
//
-unsigned WindowDecorationElements(CompWindow* win)
+unsigned WindowDecorationElements(CompWindow* win, WindowFilter::Value wf)
{
unsigned elements = DecorationElement::NONE;
if (!win)
return elements;
- if (!win->isViewable())
+ if (!win->isViewable() && wf == WindowFilter::NONE)
return elements;
if (win->wmType() & (CompWindowTypeDockMask | CompWindowTypeDesktopMask))
@@ -208,7 +208,7 @@ unsigned WindowDecorationElements(CompWindow* win)
if (!win->overrideRedirect() &&
(win->type() & DECORABLE_WINDOW_TYPES) &&
- (win->frame() || win->hasUnmapReference()))
+ (win->frame() || win->hasUnmapReference() || wf == WindowFilter::UNMAPPED))
{
if (win->actions() & CompWindowActionResizeMask)
elements |= DecorationElement::EDGE;
diff --git a/unity-shared/CompizUtils.h b/unity-shared/CompizUtils.h
index f1885a5cc..8129ab2b7 100644
--- a/unity-shared/CompizUtils.h
+++ b/unity-shared/CompizUtils.h
@@ -119,7 +119,18 @@ private:
cairo_t *cr_;
};
-enum DecorationElement
+namespace WindowFilter
+{
+enum Value
+{
+ NONE,
+ UNMAPPED
+};
+}
+
+namespace DecorationElement
+{
+enum
{
NONE = 0,
EDGE = (1 << 0),
@@ -127,8 +138,9 @@ enum DecorationElement
BORDER = (1 << 2),
FULL = EDGE|SHADOW|BORDER
};
+}
-unsigned WindowDecorationElements(CompWindow*);
+unsigned WindowDecorationElements(CompWindow*, WindowFilter::Value wf = WindowFilter::NONE);
bool IsWindowEdgeDecorable(CompWindow*);
bool IsWindowShadowDecorable(CompWindow*);