Merge lp:~alan-griffiths/compiz-core/isVisible into lp:compiz-core

Proposed by Alan Griffiths
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 2999
Merged at revision: 2999
Proposed branch: lp:~alan-griffiths/compiz-core/isVisible
Merge into: lp:compiz-core
Diff against target: 81 lines (+16/-10)
2 files modified
src/privatewindow.h (+2/-6)
src/window.cpp (+14/-4)
To merge this branch: bzr merge lp:~alan-griffiths/compiz-core/isVisible
Reviewer Review Type Date Requested Status
Compiz Maintainers Pending
Review via email: mp+93010@code.launchpad.net

Description of the change

Small piece of code tidy-up.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/privatewindow.h'
2--- src/privatewindow.h 2012-01-31 14:52:20 +0000
3+++ src/privatewindow.h 2012-02-14 15:30:24 +0000
4@@ -34,12 +34,6 @@
5 #include <core/timer.h>
6 #include "privatescreen.h"
7
8-#define WINDOW_INVISIBLE(w) \
9- ((w)->attrib.map_state != IsViewable || \
10- (w)->attrib.x + (w)->width + (w)->output.right <= 0 || \
11- (w)->attrib.y + (w)->height + (w)->output.bottom <= 0 || \
12- (w)->attrib.x - (w)->output.left >= (int) screen->width () || \
13- (w)->attrib.y - (w)->output.top >= (int) screen->height () )
14
15 typedef CompWindowExtents CompFullscreenMonitorSet;
16
17@@ -61,6 +55,8 @@
18
19 bool isGroupTransient (Window clientLeader);
20
21+ bool isInvisible() const;
22+
23 static bool stackLayerCheck (CompWindow *w,
24 Window clientLeader,
25 CompWindow *below);
26
27=== modified file 'src/window.cpp'
28--- src/window.cpp 2012-01-31 14:52:20 +0000
29+++ src/window.cpp 2012-02-14 15:30:24 +0000
30@@ -71,6 +71,16 @@
31 w->pluginClasses.resize (windowPluginClassIndices.size ());
32 }
33
34+inline bool
35+PrivateWindow::isInvisible() const
36+{
37+ return attrib.map_state != IsViewable ||
38+ attrib.x + width + output.right <= 0 ||
39+ attrib.y + height + output.bottom <= 0 ||
40+ attrib.x - output.left >= (int) screen->width () ||
41+ attrib.y - output.top >= (int) screen->height ();
42+}
43+
44 bool
45 PrivateWindow::isAncestorTo (CompWindow *transient,
46 CompWindow *ancestor)
47@@ -1841,7 +1851,7 @@
48
49 resizeNotify (dx, dy, dwidth, dheight);
50
51- priv->invisible = WINDOW_INVISIBLE (priv);
52+ priv->invisible = priv->isInvisible ();
53 }
54 else if (priv->geometry.x () != gm.x () || priv->geometry.y () != gm.y ())
55 {
56@@ -1858,7 +1868,7 @@
57 if (!priv->frameRegion.isEmpty ())
58 priv->frameRegion.translate (dx, dy);
59
60- priv->invisible = WINDOW_INVISIBLE (priv);
61+ priv->invisible = priv->isInvisible ();
62
63 moveNotify (dx, dy, true);
64 }
65@@ -2192,7 +2202,7 @@
66 if (!priv->frameRegion.isEmpty ())
67 priv->frameRegion.translate (dx, dy);
68
69- priv->invisible = WINDOW_INVISIBLE (priv);
70+ priv->invisible = priv->isInvisible ();
71
72 moveNotify (dx, dy, immediate);
73 }
74@@ -6459,7 +6469,7 @@
75
76 if (priv->attrib.map_state == IsViewable)
77 {
78- priv->invisible = WINDOW_INVISIBLE (priv);
79+ priv->invisible = priv->isInvisible ();
80 }
81 }
82

Subscribers

People subscribed via source and target branches