VT switching back to the initial VT is possible in the following case:
  #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)

Make it possible to prevent that from happening if -novtswitch was
passed, which should make the life of display manager developers easier,
especially when it comes to handling multiple users.

X.Org Bug 37174 <http://bugs.freedesktop.org/show_bug.cgi?id=37174>

Signed-off-by: Cyril Brulebois <k...@debian.org>
---
 hw/xfree86/os-support/bsd/bsd_init.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

Patch tested on a GNU/kFreeBSD VM, on top of 1.10.2rc1. Applies on top
of master too, but not tested against it.

diff --git a/hw/xfree86/os-support/bsd/bsd_init.c 
b/hw/xfree86/os-support/bsd/bsd_init.c
index 123eb17..77667bb 100644
--- a/hw/xfree86/os-support/bsd/bsd_init.c
+++ b/hw/xfree86/os-support/bsd/bsd_init.c
@@ -41,6 +41,7 @@
 #include <errno.h>
 
 static Bool KeepTty = FALSE;
+static Bool VTSwitch = TRUE;
 static int devConsoleFd = -1;
 #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
 static int VTnum = -1;
@@ -680,7 +681,7 @@ xf86CloseConsole()
                           strerror(errno));
         }
 #endif
-       if (initialVT != -1)
+       if ((initialVT != -1) && VTSwitch)
                ioctl(xf86Info.consoleFd, VT_ACTIVATE, initialVT);
         break;
 #endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
@@ -723,6 +724,11 @@ xf86ProcessArgument(int argc, char *argv[], int i)
                return 1;
        }
 #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
+       if (!strcmp(argv[i], "-novtswitch"))
+       {
+               VTSwitch = FALSE;
+               return 1;
+       }
        if (!strcmp(argv[i], "-sharevts"))
        {       
                ShareVTs = TRUE;
-- 
1.7.5.1

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to