From 6ffd9238078f9050a566dd6da5a124e92bb62b05 Mon Sep 17 00:00:00 2001 From: Brian Cameron Date: Mon, 9 Apr 2007 04:10:09 +0000 Subject: Slightly better fix that causes gdmflexiserver to display the dialog GUI 2007-04-09 Brian Cameron * gui/gdmflexiserver.c: Slightly better fix that causes gdmflexiserver to display the dialog GUI when not using --command, and display a text error when using --command. svn path=/trunk/; revision=4790 --- ChangeLog | 6 ++++++ gui/gdmflexiserver.c | 55 +++++++++++++++++++++++++++++++--------------------- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index d1a360ea..90c3630f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-04-09 Brian Cameron + + * gui/gdmflexiserver.c: Slightly better fix that causes gdmflexiserver + to display the dialog GUI when not using --command, and display a + text error when using --command. + 2007-04-09 Brian Cameron * gui/gdmflexiserver.c: Report an error message when the gdmcomm_check diff --git a/gui/gdmflexiserver.c b/gui/gdmflexiserver.c index 1c291856..fecbc37a 100644 --- a/gui/gdmflexiserver.c +++ b/gui/gdmflexiserver.c @@ -767,12 +767,26 @@ main (int argc, char *argv[]) if (args_remaining != NULL && args_remaining[0] != NULL) server = args_remaining[0]; - if ( ! gdmcomm_check (FALSE)) { - gdm_common_error ("Error: GDM (GNOME Display Manager) is not " - "running."); - gdm_common_error ("You might be using a different display " - "manager."); - return 1; + if (send_command != NULL) { + if ( ! gdmcomm_check (FALSE)) { + gdm_common_error ("Error: GDM (GNOME Display Manager) " + "is not running."); + gdm_common_error ("You might be using a different " + "display manager."); + return 1; + } + } else { + /* + * The --command argument does not display anything, so avoid + * running gtk_init until it finishes. Sometimes the + * --command argument is used when there is no display so it + * will fail and cause the program to exit, complaining about + * "no display". + */ + gtk_init(&argc, &argv); + if ( ! gdmcomm_check (TRUE)) { + return 1; + } } /* Start reading config data in bulk */ @@ -839,25 +853,22 @@ main (int argc, char *argv[]) } /* - * The --command argument does not display anything, so avoid running - * gtk_init until it finishes. Sometimes the --command argument is - * used when there is no display so it will fail and cause the - * program to exit, complaining about "no display". + * Now process what gdmflexiserver is more frequently used to + * do, start VT (Virtual Terminal) sesions - at least on + * systems where it is supported. On systems where it is not + * supporteed VT stands for "Very Tight" and will mess up your + * display if you use it. Tight! So do not use it. * - * Now process what gdmflexiserver is more used to do, start a - * VT virtual terminal sesions - at least on systems where it - * works. On systems where it doesn't work VT stands for - * "Very Tight" and will mess up your display if you try to - * use it. Tight! So don't use it. I'd accept a patch to - * disable it, but its easy to avoid not using it as long - * as your distro doesn't put the menu choice in the - * application launch button on the panel (don't ship the - * desktop file). + * I would accept a patch to disable it on such systems, but it + * is easy to avoid not using it as long as your distro does not + * put the menu choice in the application launch button on the + * panel (don't ship the desktop file). */ - gtk_init(&argc, &argv); - /* always attempt to get cookie and authenticate. On remote - servers */ + /* + * Always attempt to get cookie and authenticate. On remote + * servers + */ auth_cookie = gdmcomm_get_auth_cookie (); /* check for other displays/logged in users */ -- cgit v1.2.1