| 1 | From 46cf2a60934076bf568062eb83121ce90b6ff596 Mon Sep 17 00:00:00 2001 |
| 2 | From: =?UTF-8?q?La=C3=A9rcio=20de=20Sousa?= <lbsousajr@gmail.com> |
| 3 | Date: Thu, 12 Dec 2013 14:22:48 -0200 |
| 4 | Subject: [PATCH] xfree86: Keep a non-seat0 X server from touching VTs (#71258) |
| 5 | |
| 6 | Updated patch following Hans de Goede's advice. |
| 7 | |
| 8 | If -seat option is passed with a value different from seat0, |
| 9 | X server won't call xf86OpenConsole(). |
| 10 | |
| 11 | This is needed to avoid any race condition between seat0 and |
| 12 | non-seat0 X servers. If a non-seat0 X server opens a given VT |
| 13 | before a seat0 one which expects to open the same VT, one can |
| 14 | get an inactive systemd-logind graphical session for seat0. |
| 15 | |
| 16 | This patch was first tested in a multiseat setup with multiple |
| 17 | video cards and works quite well. |
| 18 | |
| 19 | I suppose it can also make things like DontVTSwitch and -sharevts |
| 20 | meaningless for non-seat0 seats, so it may fix bug #69477, too. |
| 21 | |
| 22 | Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=71258 |
| 23 | https://bugs.freedesktop.org/show_bug.cgi?id=69477 (maybe) |
| 24 | |
| 25 | See also: http://lists.x.org/archives/xorg-devel/2013-October/038391.html |
| 26 | https://bugzilla.redhat.com/show_bug.cgi?id=1018196 |
| 27 | |
| 28 | Signed-off-by: Hans de Goede <hdegoede@redhat.com> |
| 29 | Reviewed-by: Hans de Goede <hdegoede@redhat.com> |
| 30 | --- |
| 31 | hw/xfree86/common/xf86Init.c | 3 ++- |
| 32 | 1 file changed, 2 insertions(+), 1 deletion(-) |
| 33 | |
| 34 | --- a/hw/xfree86/common/xf86Init.c |
| 35 | +++ b/hw/xfree86/common/xf86Init.c |
| 36 | @@ -575,7 +575,8 @@ InitOutput(ScreenInfo * pScreenInfo, int |
| 37 | if (NEED_IO_ENABLED(flags)) |
| 38 | want_hw_access = TRUE; |
| 39 | |
| 40 | - if (!(flags & HW_SKIP_CONSOLE)) |
| 41 | + /* Non-seat0 X servers should not open console */ |
| 42 | + if (!(flags & HW_SKIP_CONSOLE) && !ServerIsNotSeat0()) |
| 43 | xorgHWOpenConsole = TRUE; |
| 44 | |
| 45 | i++; |