[PATCH] Add a command line switch to disable X11 connection
Pavel Tsekov
ptsekov at gmx.net
Sat Jan 28 09:45:46 UTC 2006
The patch is pretty simple. Comments, etc are much appreciated.
-------------- next part --------------
Index: src/main.c
===================================================================
RCS file: /cvsroot/mc/mc/src/main.c,v
retrieving revision 1.363
diff -u -p -r1.363 main.c
--- src/main.c 2 Nov 2005 11:50:52 -0000 1.363
+++ src/main.c 28 Jan 2006 09:39:49 -0000
@@ -274,6 +277,10 @@ char *mc_home = NULL;
char cmd_buf[512];
+#ifdef HAVE_TEXTMODE_X11_SUPPORT
+int ignore_window_system = 0;
+#endif
+
static void
reload_panelized (WPanel *panel)
{
@@ -1956,6 +1964,10 @@ static const struct poptOption argument_
N_("Displays this help message"), NULL},
{"version", 'V', POPT_ARG_NONE, NULL, 'V',
N_("Displays the current version"), NULL},
+#ifdef HAVE_TEXTMODE_X11_SUPPORT
+ {"no-x", '\0', POPT_ARG_NONE, &ignore_window_system, 0,
+ N_("Do not use the X Window System"), NULL},
+#endif
/* terminal options */
{"xterm", 'x', POPT_ARG_NONE, &force_xterm, 0,
Index: src/main.h
===================================================================
RCS file: /cvsroot/mc/mc/src/main.h,v
retrieving revision 1.62
diff -u -p -r1.62 main.h
--- src/main.h 5 Sep 2005 02:10:48 -0000 1.62
+++ src/main.h 28 Jan 2006 09:39:49 -0000
@@ -69,6 +70,9 @@ extern int output_starts_shell;
extern int midnight_shutdown;
extern char cmd_buf [512];
extern const char *shell;
+#ifdef HAVE_TEXTMODE_X11_SUPPORT
+extern int ignore_window_system;
+#endif
/* Ugly hack in order to distinguish between left and right panel in menubar */
extern int is_right; /* If the selected menu was the right */
Index: src/key.c
===================================================================
RCS file: /cvsroot/mc/mc/src/key.c,v
retrieving revision 1.86
diff -u -p -r1.86 key.c
--- src/key.c 7 Jan 2006 12:49:08 -0000 1.86
+++ src/key.c 28 Jan 2006 09:39:49 -0000
@@ -408,6 +408,9 @@ static Window x11_window;
static void
init_key_x11 (void)
{
+ if (ignore_window_system)
+ return;
+
if (!getenv ("DISPLAY"))
return;
More information about the mc-devel
mailing list