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
=== modified file 'src/privatewindow.h'
--- src/privatewindow.h 2012-01-31 14:52:20 +0000
+++ src/privatewindow.h 2012-02-14 15:30:24 +0000
@@ -34,12 +34,6 @@
34#include <core/timer.h>34#include <core/timer.h>
35#include "privatescreen.h"35#include "privatescreen.h"
3636
37#define WINDOW_INVISIBLE(w) \
38 ((w)->attrib.map_state != IsViewable || \
39 (w)->attrib.x + (w)->width + (w)->output.right <= 0 || \
40 (w)->attrib.y + (w)->height + (w)->output.bottom <= 0 || \
41 (w)->attrib.x - (w)->output.left >= (int) screen->width () || \
42 (w)->attrib.y - (w)->output.top >= (int) screen->height () )
4337
44typedef CompWindowExtents CompFullscreenMonitorSet;38typedef CompWindowExtents CompFullscreenMonitorSet;
4539
@@ -61,6 +55,8 @@
6155
62 bool isGroupTransient (Window clientLeader);56 bool isGroupTransient (Window clientLeader);
6357
58 bool isInvisible() const;
59
64 static bool stackLayerCheck (CompWindow *w,60 static bool stackLayerCheck (CompWindow *w,
65 Window clientLeader,61 Window clientLeader,
66 CompWindow *below);62 CompWindow *below);
6763
=== modified file 'src/window.cpp'
--- src/window.cpp 2012-01-31 14:52:20 +0000
+++ src/window.cpp 2012-02-14 15:30:24 +0000
@@ -71,6 +71,16 @@
71 w->pluginClasses.resize (windowPluginClassIndices.size ());71 w->pluginClasses.resize (windowPluginClassIndices.size ());
72}72}
7373
74inline bool
75PrivateWindow::isInvisible() const
76{
77 return attrib.map_state != IsViewable ||
78 attrib.x + width + output.right <= 0 ||
79 attrib.y + height + output.bottom <= 0 ||
80 attrib.x - output.left >= (int) screen->width () ||
81 attrib.y - output.top >= (int) screen->height ();
82}
83
74bool84bool
75PrivateWindow::isAncestorTo (CompWindow *transient,85PrivateWindow::isAncestorTo (CompWindow *transient,
76 CompWindow *ancestor)86 CompWindow *ancestor)
@@ -1841,7 +1851,7 @@
18411851
1842 resizeNotify (dx, dy, dwidth, dheight);1852 resizeNotify (dx, dy, dwidth, dheight);
18431853
1844 priv->invisible = WINDOW_INVISIBLE (priv);1854 priv->invisible = priv->isInvisible ();
1845 }1855 }
1846 else if (priv->geometry.x () != gm.x () || priv->geometry.y () != gm.y ())1856 else if (priv->geometry.x () != gm.x () || priv->geometry.y () != gm.y ())
1847 {1857 {
@@ -1858,7 +1868,7 @@
1858 if (!priv->frameRegion.isEmpty ())1868 if (!priv->frameRegion.isEmpty ())
1859 priv->frameRegion.translate (dx, dy);1869 priv->frameRegion.translate (dx, dy);
18601870
1861 priv->invisible = WINDOW_INVISIBLE (priv);1871 priv->invisible = priv->isInvisible ();
18621872
1863 moveNotify (dx, dy, true);1873 moveNotify (dx, dy, true);
1864 }1874 }
@@ -2192,7 +2202,7 @@
2192 if (!priv->frameRegion.isEmpty ())2202 if (!priv->frameRegion.isEmpty ())
2193 priv->frameRegion.translate (dx, dy);2203 priv->frameRegion.translate (dx, dy);
21942204
2195 priv->invisible = WINDOW_INVISIBLE (priv);2205 priv->invisible = priv->isInvisible ();
21962206
2197 moveNotify (dx, dy, immediate);2207 moveNotify (dx, dy, immediate);
2198 }2208 }
@@ -6459,7 +6469,7 @@
64596469
6460 if (priv->attrib.map_state == IsViewable)6470 if (priv->attrib.map_state == IsViewable)
6461 {6471 {
6462 priv->invisible = WINDOW_INVISIBLE (priv);6472 priv->invisible = priv->isInvisible ();
6463 }6473 }
6464}6474}
64656475

Subscribers

People subscribed via source and target branches