git: 016555283010 - main - x11/gdm: Fix bug where we go to console on logout

From: Neel Chauhan <nc_at_FreeBSD.org>
Date: Sun, 27 Mar 2022 20:04:25 UTC
The branch main has been updated by nc:

URL: https://cgit.FreeBSD.org/ports/commit/?id=016555283010d8f61e6d5a2713442010fddb46dc

commit 016555283010d8f61e6d5a2713442010fddb46dc
Author:     Neel Chauhan <nc@FreeBSD.org>
AuthorDate: 2022-03-27 20:04:23 +0000
Commit:     Neel Chauhan <nc@FreeBSD.org>
CommitDate: 2022-03-27 20:04:23 +0000

    x11/gdm: Fix bug where we go to console on logout
---
 x11/gdm/Makefile                        |  1 +
 x11/gdm/files/patch-data_Init.in        | 66 ---------------------------------
 x11/gdm/files/patch-data_PostSession.in | 14 +++----
 x11/gdm/files/patch-data_PreSession.in  | 14 -------
 4 files changed, 6 insertions(+), 89 deletions(-)

diff --git a/x11/gdm/Makefile b/x11/gdm/Makefile
index d724d456eee5..eb2116ffa0b8 100644
--- a/x11/gdm/Makefile
+++ b/x11/gdm/Makefile
@@ -2,6 +2,7 @@
 
 PORTNAME=	gdm
 PORTVERSION=	42.0
+PORTREVISION=	1
 CATEGORIES=	x11 gnome
 MASTER_SITES=	GNOME/sources/${PORTNAME}/${PORTVERSION:C/^([0-9]+)\..*/\1/}
 DIST_SUBDIR=	gnome
diff --git a/x11/gdm/files/patch-data_Init.in b/x11/gdm/files/patch-data_Init.in
deleted file mode 100644
index 7ec028b66b5b..000000000000
--- a/x11/gdm/files/patch-data_Init.in
+++ /dev/null
@@ -1,66 +0,0 @@
---- data/Init.in.orig	2022-03-21 18:12:40 UTC
-+++ data/Init.in
-@@ -6,6 +6,19 @@ OLD_IFS=$IFS
- PATH="@X_PATH@:$PATH"
- OLD_IFS=$IFS
- 
-+# enhance fade in look;
-+# gnome-shell-3.38.1/data/theme/gnome-shell-sass/widgets/_screen-shield.scss:
-+# #lockDialogGroup {
-+#   background-color: lighten(#2e3436, 8%);
-+# }
-+xsetroot -solid "#2e3436"
-+
-+# wait for ttys to be initialized
-+while ! pgrep -qf "^/usr/libexec/getty "; do
-+	sleep 1
-+	[ $((i++)) -ge 10 ] && break
-+done
-+
- gdmwhich () {
-   COMMAND="$1"
-   OUTPUT=
-@@ -22,10 +35,10 @@ gdmwhich () {
-   echo "$OUTPUT"
- }
- 
--if [ -f /etc/X11/Xresources ]; then
--    sysresources=/etc/X11/Xresources
-+if [ -f /usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/etc/X11/Xresources ]; then
-+    sysresources=/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/etc/X11/Xresources
- else
--    sysresources=/usr/etc/X11/Xresources
-+    sysresources=/usr/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/etc/X11/Xresources
- fi
- 
- # merge in defaults
-@@ -33,10 +46,10 @@ fi
-     xrdb -nocpp -merge "$sysresources"
- fi
- 
--if [ -f /etc/X11/Xmodmap ]; then
--    sysmodmap=/etc/X11/Xmodmap
-+if [ -f /usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/etc/X11/Xmodmap ]; then
-+    sysmodmap=/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/etc/X11/Xmodmap
- else
--    sysmodmap=/usr/etc/X11/Xmodmap
-+    sysmodmap=/usr/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/etc/X11/Xmodmap
- fi
- 
- XMODMAP=`gdmwhich xmodmap`
-@@ -93,5 +106,15 @@ fi
-     fi
-   fi
- fi
-+
-+# /usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/etc/X11/xenodm/GiveConsole, fbtab(5)
-+if [ -c /dev/dri/card0 ]; then
-+    /usr/sbin/chown _gdm /dev/dri/card0
-+fi
-+if [ -c /dev/dri/renderD128 ]; then
-+    /usr/sbin/chown _gdm /dev/dri/renderD128
-+fi
-+# XXX OpenBSD needs an implementation of XDG_RUNTIME_DIR
-+rm -rf /var/db/gdm/.cache/gnome-shell/runtime-state-*
- 
- exit 0
diff --git a/x11/gdm/files/patch-data_PostSession.in b/x11/gdm/files/patch-data_PostSession.in
index d8752cc882b3..bb4969327dec 100644
--- a/x11/gdm/files/patch-data_PostSession.in
+++ b/x11/gdm/files/patch-data_PostSession.in
@@ -1,14 +1,10 @@
---- data/PostSession.in.orig	2022-03-21 18:12:40 UTC
+--- data/PostSession.in.orig	2022-03-27 19:50:55 UTC
 +++ data/PostSession.in
-@@ -1,3 +1,11 @@
+@@ -1,3 +1,7 @@
  #!/bin/sh
  
-+# /usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/etc/X11/xenodm/TakeConsole, fbtab(5)
-+if [ -c /dev/dri/card0 ]; then
-+    /usr/sbin/chown root /dev/dri/card0
-+fi
-+if [ -c /dev/dri/renderD128 ]; then
-+    /usr/sbin/chown root /dev/dri/renderD128
-+fi
++# XXX: I hate this "solution", but we need to manually restart gdm here
++# otherwise we reach the console when we logout
++/usr/sbin/service gdm restart
 +
  exit 0
diff --git a/x11/gdm/files/patch-data_PreSession.in b/x11/gdm/files/patch-data_PreSession.in
deleted file mode 100644
index 31abf42f57d9..000000000000
--- a/x11/gdm/files/patch-data_PreSession.in
+++ /dev/null
@@ -1,14 +0,0 @@
---- data/PreSession.in.orig	2022-03-21 18:12:40 UTC
-+++ data/PreSession.in
-@@ -7,3 +7,11 @@ PATH="@X_PATH@:$PATH"
- # Note that output goes into the .xsession-errors file for easy debugging
- #
- PATH="@X_PATH@:$PATH"
-+
-+# /usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/usr/local/etc/X11/xenodm/GiveConsole, fbtab(5)
-+if [ -c /dev/dri/card0 ]; then
-+    /usr/sbin/chown $USER /dev/dri/card0
-+fi
-+if [ -c /dev/dri/renderD128 ]; then
-+    /usr/sbin/chown $USER /dev/dri/renderD128
-+fi