summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornigel <nigel>2006-10-17 12:57:41 +0000
committernigel <nigel>2006-10-17 12:57:41 +0000
commit1f76c25be4b426ec0d6549d7769f4d814e7dea54 (patch)
tree24bb48d089c0d83919a8416ebb9d8ce09551df9f /src
parent6e7e6ddd088e9b675373d568728429adc830432a (diff)
downloadberyl-manager-1f76c25be4b426ec0d6549d7769f4d814e7dea54.tar.gz
beryl-manager-1f76c25be4b426ec0d6549d7769f4d814e7dea54.tar.bz2
Make SIGUSR2 toggle between Beryl and fallback WM if Beryl is used (for suspend-to-disk support).
Diffstat (limited to 'src')
-rw-r--r--src/main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 8e59ac5..33d440a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -109,6 +109,7 @@ usage (const char *programName)
static void
signalHandler (int sig)
{
+ static int suspending = 0;
switch (sig)
{
case SIGUSR1:
@@ -116,6 +117,19 @@ signalHandler (int sig)
//Could be missleading to the average user...
showMenu(0,gtk_get_current_event_time());
break;
+ case SIGUSR2:
+ if (!suspending) {
+ if (!WM) {
+ WM=fallBackWM + 4;
+ startWM();
+ suspending = 1;
+ }
+ } else {
+ WM=0;
+ startBeryl();
+ suspending = 0;
+ }
+ break;
default:
break;
}
@@ -1160,6 +1174,7 @@ int main(int argc, char ** argv)
launchWM();
}
signal (SIGUSR1, signalHandler);
+ signal (SIGUSR2, signalHandler);
gtk_main();
gdk_threads_leave ();