summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDidier Roche <didrocks@ubuntu.com>2010-11-19 13:15:51 +0100
committerDidier Roche <didrocks@ubuntu.com>2010-11-19 13:15:51 +0100
commitefef10abbab34d922e75f2f9ef217c8545fd4b91 (patch)
tree7c49c547d36ee0492d0b5329949afcf086b6034a
parente1709b2b3cdd00acdf34122c081d66cfd5830748 (diff)
downloadbailer-efef10abbab34d922e75f2f9ef217c8545fd4b91.tar.gz
bailer-efef10abbab34d922e75f2f9ef217c8545fd4b91.tar.bz2
renamed to ensureShell and add signal + option to select custom shell
-rw-r--r--bailer.xml.in4
-rw-r--r--src/bailer.cpp25
-rw-r--r--src/bailer.h2
3 files changed, 26 insertions, 5 deletions
diff --git a/bailer.xml.in b/bailer.xml.in
index ac4f2b7..6172d16 100644
--- a/bailer.xml.in
+++ b/bailer.xml.in
@@ -31,6 +31,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..a927570 100644
--- a/src/bailer.cpp
+++ b/src/bailer.cpp
@@ -60,7 +60,7 @@ 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
@@ -68,9 +68,24 @@ BailerScreen::detectFallbackWM ()
*
*/
void
-BailerScreen::ensureDesktopServices ()
+BailerScreen::ensureShell ()
{
+ CompString alternative_shell = optionGetCustomAlternativeShell();
+ compLogMessage ("bailer",
+ CompLogLevelInfo,
+ "Ensuring a shell for your session");
+
+ 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 +149,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 +247,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 ();