Fix startx auto display select not working when a Xserver started by

gdm is running
This commit is contained in:
Hans de Goede 2015-03-20 15:02:04 +01:00
parent a9b446338e
commit b5175fc982
3 changed files with 82 additions and 3 deletions

View File

@ -0,0 +1,36 @@
From 848dc9b7f3a95f14efd4ea34188cba51965c9f53 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Fri, 20 Mar 2015 14:25:44 +0100
Subject: [PATCH xinit 2/3] startx: Fix startx picking an already used display
number when -nolock is used
Currently startx relies on /tmp/.X?-lock being present for automatically
picking a free display number. This does not work if -nolock is used when
starting the server, or if the server is started with -displayfd as -displayfd
implies -nolock.
This is becoming a problem now that -displayfd is getting used by
display-managers (e.g. gdm), this fixes this by also checking for
/tmp/.X11-unix/X?
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
startx.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/startx.cpp b/startx.cpp
index 8520399..fe49996 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -120,7 +120,7 @@ enable_xauth=1
XCOMM Automatically determine an unused $DISPLAY
d=0
while true ; do
- [ -e /tmp/.X$d-lock ] || break
+ [ -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ] || break
d=$(($d + 1))
done
defaultdisplay=":$d"
--
2.3.3

View File

@ -0,0 +1,35 @@
From 72939fed64b00be4a74dd0e1bf0b418e00ac4c57 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Fri, 20 Mar 2015 14:30:08 +0100
Subject: [PATCH xinit 3/3] startx: Make startx auto display select work with
per user /tmp dirs
If a separate /tmp per user is used the existing auto display select code
does not work, add an extra check for the unix socket for the display number
existing in /proc/net/unix (linux only).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
startx.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/startx.cpp b/startx.cpp
index fe49996..3b0dd86 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -120,7 +120,11 @@ enable_xauth=1
XCOMM Automatically determine an unused $DISPLAY
d=0
while true ; do
- [ -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ] || break
+ [ -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ] ||
+#ifdef __linux__
+ grep -q "/tmp/.X11-unix/X$d" "/proc/net/unix" ||
+#endif
+ break
d=$(($d + 1))
done
defaultdisplay=":$d"
--
2.3.3

View File

@ -3,7 +3,7 @@
Summary: X.Org X11 X Window System xinit startup scripts
Name: xorg-x11-%{pkgname}
Version: 1.3.4
Release: 6%{?dist}
Release: 7%{?dist}
License: MIT
URL: http://www.x.org
@ -25,10 +25,12 @@ Patch1: xinit-1.0.2-client-session.patch
# This is the Xserver default starting at xorg-x11-server >= 1.17, drop once
# we've that version, rhbz#1111684
Patch2: 0001-startx-Pass-nolisten-tcp-by-default.patch
# submitted upstream, rhbz#1177513
# A few fixes submitted upstream, rhbz#1177513, rhbz#1203780
Patch3: 0001-startx-Pass-keeptty-when-telling-the-server-to-start.patch
Patch4: 0002-startx-Fix-startx-picking-an-already-used-display-nu.patch
Patch5: 0003-startx-Make-startx-auto-display-select-work-with-per.patch
# Fedora specific patch to match the similar patch in the xserver
Patch4: xinit-1.3.4-set-XORG_RUN_AS_USER_OK.patch
Patch6: xinit-1.3.4-set-XORG_RUN_AS_USER_OK.patch
BuildRequires: pkgconfig(x11)
BuildRequires: dbus-devel
@ -58,6 +60,8 @@ managers.
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%build
%configure
@ -111,6 +115,10 @@ install -p -m644 -D %{SOURCE18} $RPM_BUILD_ROOT%{_datadir}/xsessions/xinit-compa
%{_datadir}/xsessions/xinit-compat.desktop
%changelog
* Fri Mar 20 2015 Hans de Goede <hdegoede@redhat.com> - 1.3.4-7
- Fix startx auto display select not working when a Xserver started by
gdm is running
* Wed Mar 18 2015 Hans de Goede <hdegoede@redhat.com> - 1.3.4-6
- Set XORG_RUN_AS_USER_OK when starting X on the current tty, to run X
to run without root rights when possible