summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-10-23 23:41:41 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-10-23 23:41:41 +0800
commitd4ceef6abe6729e4b05d1cdb5fe17c6abe56c99c (patch)
tree3742aa81f2b2ad4cbb782e5c81b9cfdf1f536950
parentb02b3dd135dedb140a2aff8620dd6021904894b6 (diff)
downloaddialog-d4ceef6abe6729e4b05d1cdb5fe17c6abe56c99c.tar.gz
dialog-d4ceef6abe6729e4b05d1cdb5fe17c6abe56c99c.tar.bz2
Cleanup (static analysis)
-rw-r--r--dialog.xml.in5
-rw-r--r--src/dialog.cpp21
-rw-r--r--src/dialog.h2
3 files changed, 25 insertions, 3 deletions
diff --git a/dialog.xml.in b/dialog.xml.in
index 65a764d..d8ea8e5 100644
--- a/dialog.xml.in
+++ b/dialog.xml.in
@@ -19,6 +19,11 @@
</deps>
<options>
<group>
+ <option name="fading_windows" type="match">
+ <_short>Fading Windows</_short>
+ <_long>Windows which are allowed to fade</_long>
+ <default>Normal | Dialog | ModalDialog</default>
+ </option>
<option name="dialogtypes" type="match">
<_short>Dialog Match</_short>
<_long>Dialogs which will trigger fading</_long>
diff --git a/src/dialog.cpp b/src/dialog.cpp
index 116a088..1503cf2 100644
--- a/src/dialog.cpp
+++ b/src/dialog.cpp
@@ -23,6 +23,21 @@
COMPIZ_PLUGIN_20090315 (dialog, DialogPluginVTable);
bool
+DialogWindow::shouldFade ()
+{
+ if (window->overrideRedirect ())
+ return false;
+
+ if (!window->isViewable ())
+ return false;
+
+ if (!DialogScreen::get (screen)->optionGetFadingWindows ().evaluate (window))
+ return false;
+
+ return true;
+}
+
+bool
DialogWindow::glPaint (const GLWindowPaintAttrib &attrib,
const GLMatrix &transform,
const CompRegion &region,
@@ -71,7 +86,7 @@ DialogScreen::handleEvent (XEvent *event)
}
if (!othertrans)
{
- dww->mFaded = FALSE;
+ dww->mFaded = false;
CompositeWindow::get (ww)->addDamage ();
}
}
@@ -85,9 +100,9 @@ DialogScreen::handleEvent (XEvent *event)
{
CompWindow *ww = screen->findWindow (w->transientFor ());
DialogWindow *dww = DialogWindow::get (ww);
- if (!dww->mFaded)
+ if (!dww->mFaded && dww->shouldFade ())
{
- dww->mFaded = TRUE;
+ dww->mFaded = true;
dww->cWindow->addDamage ();
}
}
diff --git a/src/dialog.h b/src/dialog.h
index 7709867..5e1a48c 100644
--- a/src/dialog.h
+++ b/src/dialog.h
@@ -70,6 +70,8 @@ class DialogWindow :
Window mOldTransient;
+ bool shouldFade ();
+
bool
glPaint (const GLWindowPaintAttrib &,
const GLMatrix &,