summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortest-tools <test-tools>2006-10-16 10:00:04 +0000
committertest-tools <test-tools>2006-10-16 10:00:04 +0000
commit94e84d1c5acd5f85f6469c3ccc92a678f41d208d (patch)
tree11671a2dd7d98449e6fa7e2f38784f87488f870d /src
parent2da4a437301c9bd226c25f46d0a30b073ab603ad (diff)
downloadberyl-manager-94e84d1c5acd5f85f6469c3ccc92a678f41d208d.tar.gz
beryl-manager-94e84d1c5acd5f85f6469c3ccc92a678f41d208d.tar.bz2
beryl-manager: Corrected usage info, update manpage, fixed <= problems, nuked anoying not found output of which. New startup scheme should be now complete. TODOnext: Don't detect via pidof, detect via X...
Diffstat (limited to 'src')
-rw-r--r--src/main.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index 60875a1..07d0217 100644
--- a/src/main.c
+++ b/src/main.c
@@ -102,7 +102,8 @@ static void
usage (const char *programName)
{
printf (_("Usage: %s "
- "[-n] [--help] [--version]"
+ "[-d] [--force-window-manager] [--force-decorator] "
+ "[--help] [--version]"
"\n"), programName);
}
static void
@@ -303,7 +304,7 @@ gboolean is_running(const gchar * command)
}
gboolean is_decor_running()
{
- if (DM>numDM || DM<0)
+ if (DM>=numDM || DM<0)
DM=0;
return (is_running(DMs[DM].Prog));
}
@@ -704,7 +705,7 @@ gboolean detect_app(const gchar * app)
{
gint ex;
if (!g_spawn_command_line_sync(
- g_strdup_printf("sh -c 'which %s > /dev/null'",app),
+ g_strdup_printf("sh -c 'which %s > /dev/null 2>&1'",app),
NULL,NULL,&ex,NULL))
manager_error(_("can't use this app, no which"));
if (WIFEXITED(ex))
@@ -966,7 +967,7 @@ void detect_xgl()
}
int main(int argc, char ** argv)
{
- gint i;
+ gint i, found;
gchar *buffer;
gboolean daemon_mode = TRUE;
Display * d;
@@ -1055,6 +1056,13 @@ int main(int argc, char ** argv)
}
XCloseDisplay(d);
+ // Some warning about changed behaviour for the unaware user
+ if (!force_window_manager && !force_decorator) {
+ if (!strcmp (PACKAGE_VERSION, "0.1.1")) {
+ fprintf(stderr, "beryl-manager doesn't autostart window-manager/decorator\n"
+ "any more. Please consult: man beryl-manager\n\n");
+ }
+ }
gtk_init(&argc,&argv);
d = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
@@ -1081,7 +1089,7 @@ int main(int argc, char ** argv)
load_settings();
init_widgets();
- if (WM<0 || WM>(numWM))
+ if (WM<0 || WM>=(numWM))
WM=-1;
if (WM==-1)
{
@@ -1107,7 +1115,7 @@ int main(int argc, char ** argv)
}
if (fallBackWM==-1)
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(useFBItem),FALSE);
- if (DM<0 || DM > numDM)
+ if (DM<0 || DM >= numDM)
DM=-1;
if (DM==-1)
{
@@ -1127,10 +1135,20 @@ int main(int argc, char ** argv)
if (DM==-1)
manager_error("No Display Manager Found!");
save_settings();
-
+
+ found = False;
+ for (i=0;i<numDM && !found;i++) {
+ if (is_running(DMs[i].Prog))
+ found = True;
+ }
+ if (!found ||
+ (force_decorator && !is_decor_running())) {
+ g_thread_create(decorThread,NULL,FALSE,NULL); // launch decorator
+ }
+
if (!force_window_manager) {
- gint found = False;
- for (i=0;i<=numWM && !found;i++)
+ found = False;
+ for (i=0;i<numWM && !found;i++)
if (is_wm_running(i))
found = True;
if (!found)