summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-04-11 14:36:53 +0000
committerSam Spilsbury <smspillaz@gmail.com>2010-04-11 14:36:53 +0000
commit3a34e1b435f330fcc1154f83e06ca94ec914b3da (patch)
treea91c6c6639db2d5c899e3c741907350bd003df2d
parentbdbd06e941ed72b2be9d0377c253c75169e7b164 (diff)
downloadextrawm-3a34e1b435f330fcc1154f83e06ca94ec914b3da.tar.gz
extrawm-3a34e1b435f330fcc1154f83e06ca94ec914b3da.tar.bz2
Allow plugin to operate correctly without composite plugin
-rw-r--r--src/extrawm.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/extrawm.cpp b/src/extrawm.cpp
index 4dc80a5..c1535e8 100644
--- a/src/extrawm.cpp
+++ b/src/extrawm.cpp
@@ -24,6 +24,8 @@
COMPIZ_PLUGIN_20090315 (extrawm, ExtraWMPluginVTable);
+bool compositeAvailable;
+
void
ExtraWMScreen::addAttentionWindow (CompWindow *w)
{
@@ -159,6 +161,13 @@ ExtraWMScreen::toggleRedirect (CompAction *action,
xid = CompOption::getIntOptionNamed (options, "window");
w = screen->findTopLevelWindow (xid);
+ if (!compositeAvailable)
+ {
+ compLogMessage ("extrawm", CompLogLevelWarn, "composite plugin "\
+ "not loaded, cannot redirect/unredirect window\n");
+ return true;
+ }
+
if (w)
{
CompositeWindow *cWindow = CompositeWindow::get (w);
@@ -278,5 +287,10 @@ ExtraWMPluginVTable::init ()
if (!CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
return false;
+ if (!CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI))
+ compositeAvailable = false;
+ else
+ compositeAvailable = true;
+
return true;
}