summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@herrb.eu>2014-05-18 11:41:54 +0200
committerMatthieu Herrb <matthieu@herrb.eu>2014-05-18 11:41:54 +0200
commit2061a359a1f8968c88fa8ff5b9cb4739361ac33d (patch)
tree9cb1038942537b5bfab84208a1edc1ab81dfb28b
parent74bab88412f8c88b948ffb565f490005ac886b32 (diff)
parent1b23094a8606bf383ec6c7803a9cd300b1bb96a7 (diff)
Merge remote-tracking branch 'origin/master' into obsd
Conflicts: xinitrc.cpp
-rw-r--r--configure.ac6
-rw-r--r--cpprules.in2
-rw-r--r--startx.cpp76
3 files changed, 28 insertions, 56 deletions
diff --git a/configure.ac b/configure.ac
index b464d68..02cb80c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,10 +31,10 @@ AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE
-# Require X.Org macros 1.8 or later for AC_PROG_SED in XORG_DEFAULT_OPTIONS
+# Require X.Org macros 1.19 or later for TRADITIONALCPPFLAGS
m4_ifndef([XORG_MACROS_VERSION],
- [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
-XORG_MACROS_VERSION(1.8)
+ [m4_fatal([must install xorg-macros 1.19 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.19)
XORG_DEFAULT_OPTIONS
XORG_PROG_RAWCPP
diff --git a/cpprules.in b/cpprules.in
index 0931bee..870efde 100644
--- a/cpprules.in
+++ b/cpprules.in
@@ -15,4 +15,4 @@ CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \
SUFFIXES = .cpp
.cpp:
- $(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) $< | $(CPP_SED_MAGIC) > $@
+ $(AM_V_GEN)$(RAWCPP) $(TRADITIONALCPPFLAGS) $(CPP_FILES_FLAGS) $< | $(CPP_SED_MAGIC) > $@
diff --git a/startx.cpp b/startx.cpp
index c595b84..5dafce7 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -14,7 +14,7 @@ XCOMM
unset DBUS_SESSION_BUS_ADDRESS
unset SESSION_MANAGER
-#if defined(__SCO__) || defined(__UNIXWARE__) || defined(__APPLE__)
+#ifdef __APPLE__
XCOMM Check for /usr/bin/X11 and BINDIR in the path, if not add them.
XCOMM This allows startx to be placed in a place like /usr/bin or /usr/local/bin
@@ -33,11 +33,7 @@ case $PATH in
esac
XCOMM Now the "old" compiled path
-#ifdef __APPLE__
oldbindir=/usr/X11R6/bin
-#else
-oldbindir=/usr/bin/X11
-#endif
if [ -d "$oldbindir" ] ; then
case $PATH in
@@ -51,24 +47,8 @@ XCOMM so export the new PATH just in case the user changes the shell
export PATH
#endif
-#if defined(__SCO__) || defined(__UNIXWARE__)
-XCOMM Set up the XMERGE env var so that dos merge is happy under X
-
-if [ -f /usr/lib/merge/xmergeset.sh ]; then
- . /usr/lib/merge/xmergeset.sh
-elif [ -f /usr/lib/merge/console.disp ]; then
- XMERGE=`cat /usr/lib/merge/console.disp`
- export XMERGE
-fi
-
-userclientrc=$HOME/.startxrc
-sysclientrc=LIBDIR/sys.startxrc
-scouserclientrc=$HOME/.xinitrc
-scosysclientrc=XINITDIR/xinitrc
-#else
userclientrc=$HOME/.xinitrc
sysclientrc=XINITDIR/xinitrc
-#endif
userserverrc=$HOME/.xserverrc
sysserverrc=XINITDIR/xserverrc
@@ -79,6 +59,7 @@ defaultserverargs=""
defaultdisplay=":0"
clientargs=""
serverargs=""
+vtarg=""
#ifdef __APPLE__
@@ -145,21 +126,6 @@ done
defaultdisplay=":$d"
unset d
-#if defined(__SCO__) || defined(__UNIXWARE__)
-
-XCOMM SCO -t option: do not start an X server
-case $1 in
- -t) if [ -n "$DISPLAY" ]; then
- REMOTE_SERVER=TRUE
- shift
- else
- echo "DISPLAY environment variable not set"
- exit 1
- fi
- ;;
-esac
-#endif
-
whoseargs="client"
while [ x"$1" != x ]; do
case "$1" in
@@ -209,12 +175,6 @@ if [ x"$client" = x ]; then
client=$userclientrc
elif [ -f "$sysclientrc" ]; then
client=$sysclientrc
-#if defined(__SCO__) || defined(__UNIXWARE__)
- elif [ -f "$scouserclientrc" ]; then
- client=$scouserclientrc
- elif [ -f "$scosysclientrc" ]; then
- client=$scosysclientrc
-#endif
fi
fi
fi
@@ -228,6 +188,17 @@ XCOMM process server arguments
if [ x"$server" = x ]; then
server=$defaultserver
+#ifdef __linux__
+ XCOMM When starting the defaultserver start X on the current tty to avoid
+ XCOMM the startx session being seen as inactive:
+ XCOMM https://bugzilla.redhat.com/show_bug.cgi?id=806491
+ tty=$(tty)
+ if expr match "$tty" '^/dev/tty[0-9]\+$' > /dev/null; then
+ tty_num=$(echo "$tty" | grep -oE '[0-9]+$')
+ vtarg="vt$tty_num"
+ fi
+#endif
+
XCOMM For compatibility reasons, only use xserverrc if there were no server command line arguments
if [ x"$serverargs" = x -a x"$display" = x ]; then
if [ -f "$userserverrc" ]; then
@@ -243,6 +214,17 @@ if [ x"$serverargs" = x ]; then
serverargs=$defaultserverargs
fi
+XCOMM if no vt is specified add vtarg (which may be empty)
+have_vtarg="no"
+for i in $serverargs; do
+ if expr match "$i" '^vt[0-9]\+$' > /dev/null; then
+ have_vtarg="yes"
+ fi
+done
+if [ "$have_vtarg" = "no" ]; then
+ serverargs="$serverargs $vtarg"
+fi
+
XCOMM if no display, use default
if [ x"$display" = x ]; then
display=$defaultdisplay
@@ -319,21 +301,11 @@ EOF
done
fi
-#if defined(__SCO__) || defined(__UNIXWARE__)
-if [ "$REMOTE_SERVER" = "TRUE" ]; then
- exec SHELL_CMD ${client}
-else
- XINIT "$client" $clientargs -- "$server" $display $serverargs
-fi
-#else
-
#if defined(__APPLE__) || defined(__CYGWIN__)
eval XINIT \"$client\" $clientargs -- \"$server\" $display $serverargs
#else
XINIT "$client" $clientargs -- "$server" $display $serverargs
#endif
-
-#endif
retval=$?
if [ x"$enable_xauth" = x1 ] ; then