summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2010-11-25 20:21:16 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2010-11-25 20:21:16 +0800
commit8c43bc860a4445ccf9803201567bf4ea3904bcf1 (patch)
tree0895d522129e5dcfb3e38f54238706fdba9087e3
parent90dea6eb51fbde7ce771cb57a118e80038b51487 (diff)
parentd33f1f44cb4a2db2109bbb12ea435adbb1f6f9f6 (diff)
downloadbailer-8c43bc860a4445ccf9803201567bf4ea3904bcf1.tar.gz
bailer-8c43bc860a4445ccf9803201567bf4ea3904bcf1.tar.bz2
Merge branch 'master' of git://git.compiz.org/users/smspillaz/bailerHEADmaster
-rw-r--r--bailer.xml.in9
-rw-r--r--src/bailer.cpp34
-rw-r--r--src/bailer.h2
3 files changed, 39 insertions, 6 deletions
diff --git a/bailer.xml.in b/bailer.xml.in
index 6cd9aee..ee7ca1c 100644
--- a/bailer.xml.in
+++ b/bailer.xml.in
@@ -9,6 +9,11 @@
</relation>
</deps>
<category>Utility</category>
+ <deps>
+ <relation type="before">
+ <plugin>opengl</plugin>
+ </relation>
+ </deps>
<options>
<option name="fatal_fallback_mode" type="int">
<_short>Fatal fallback mode</_short>
@@ -37,6 +42,10 @@
<_short>Custom fallback window manager command</_short>
<_long>Command to execute when selecting to do a custom fallback</_long>
</option>
+ <option name="custom_alternative_shell" type="string">
+ <_short>Custom alternative shell command</_short>
+ <_long>If compiz is providing a shell and it can't load, an alternative shell will be launched. This is to override the alternative shell detection</_long>
+ </option>
<option name="poor_performance_fallback" type="int">
<_short>Poor performance fallback</_short>
<_long>What do do when plugins indicate that performance is reading poor levels</_long>
diff --git a/src/bailer.cpp b/src/bailer.cpp
index 2937514..76c62f6 100644
--- a/src/bailer.cpp
+++ b/src/bailer.cpp
@@ -34,6 +34,7 @@
COMPIZ_PLUGIN_20090315 (bailer, BailerPluginVTable);
static CompString reducedFunctionalityUnload[] = {"opengl", "composite"};
+static CompString compizShellUnload[] = {"unityshell"};
static CompString noARBUnload[] = {"colorfilter", "blur", "bicubic", "water", "reflex"};
static CompString noComplexUnload[] = {"blur", "water"};
@@ -60,17 +61,38 @@ BailerScreen::detectFallbackWM ()
}
/*
- * BailerScreen::ensureDesktopServices
+ * BailerScreen::ensureShell
*
* Because compiz might be providing the panel shell or whatever
* (eg, Ubuntu's Unity plugin), we need to ensure that our desktop
- * services come back when compiz goes away.
+ * services come back when compiz goes away or when the Compiz
+ * shell(s) can't run.
*
*/
void
-BailerScreen::ensureDesktopServices ()
+BailerScreen::ensureShell ()
{
+
+ CompString alternative_shell = optionGetCustomAlternativeShell();
+ compLogMessage ("bailer",
+ CompLogLevelInfo,
+ "Ensuring a shell for your session");
+
+ /* FIXME: will be nicer to get the detection module at start and so, not loading plugin rather
+ than unloading them, isn't it? */
+ unloadPlugins (compizShellUnload);
+
+ if (strcmp (alternative_shell.c_str (), "") != 0)
+ {
+ compLogMessage ("bailer",
+ CompLogLevelInfo,
+ "Custom shell set: no detection magic: %s", alternative_shell.c_str ());
+ screen->runCommand (alternative_shell.c_str ());
+ return;
+ }
+
if (getenv ("GNOME_DESKTOP_SESSION_ID") != NULL)
+ /* FIXME: use or hack gnome-session to get it respawned on crash */
screen->runCommand ("killall gnome-panel && gnome-panel");
}
@@ -134,12 +156,12 @@ BailerScreen::doFatalFallback ()
case BailerOptions::FatalFallbackModeReducedFunctionalityMode:
unloadPlugins (reducedFunctionalityUnload); break;
case BailerOptions::FatalFallbackModeDetectSessionFallback:
- ensureDesktopServices ();
+ ensureShell ();
screen->runCommand (detectFallbackWM ().c_str ());
exit (EXIT_FAILURE);
break;
case BailerOptions::FatalFallbackModeExecuteCustomFallback:
- ensureDesktopServices ();
+ ensureShell ();
screen->runCommand (optionGetCustomFallbackWindowManager ().c_str ());
exit (EXIT_FAILURE);
case BailerOptions::FatalFallbackModeNoAction:
@@ -232,6 +254,8 @@ BailerScreen::handleCompizEvent (const char *plugin, const char *event,
if (strcmp (event, "fatal_fallback") == 0)
doFatalFallback ();
+ if (strcmp (event, "ensure_shell") == 0)
+ ensureShell ();
screen->handleCompizEvent (plugin, event, options);
}
diff --git a/src/bailer.h b/src/bailer.h
index b5ead6a..927fac5 100644
--- a/src/bailer.h
+++ b/src/bailer.h
@@ -62,7 +62,7 @@ class BailerScreen :
CompTimer mSafeUnloadTimer;
CompString detectFallbackWM ();
- void ensureDesktopServices ();
+ void ensureShell ();
void doFatalFallback ();
void doPerformanceFallback ();