SHA256
1
0
forked from pool/gdm

Accepting request 239083 from home:fcrozat:branches:GNOME:Factory

- Add gdm-plymouth-vt1.patch: switch back to VT1 when terminating
  gdm, if plymouth was running at startup [bnc#881676].
(patch valid for openSUSE and SLE12)

OBS-URL: https://build.opensuse.org/request/show/239083
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gdm?expand=0&rev=270
This commit is contained in:
Dominique Leuenberger 2014-07-01 11:03:04 +00:00 committed by Git OBS Bridge
parent 4195bc4a3f
commit edc8240b70
3 changed files with 75 additions and 0 deletions

66
gdm-plymouth-vt1.patch Normal file
View File

@ -0,0 +1,66 @@
Index: gdm-3.12.2/daemon/main.c
===================================================================
--- gdm-3.12.2.orig/daemon/main.c
+++ gdm-3.12.2/daemon/main.c
@@ -33,6 +33,8 @@
#include <sys/wait.h>
#include <locale.h>
#include <signal.h>
+#include <sys/ioctl.h>
+#include <sys/vt.h>
#include <glib.h>
#include <glib/gi18n.h>
@@ -308,6 +310,23 @@ block_sigusr1 (void)
sigprocmask (SIG_BLOCK, &mask, NULL);
}
+static void
+jump_to_vt (int vt_number)
+{
+ int fd;
+
+ fd = open ("/dev/tty0", O_RDWR | O_NOCTTY);
+ if (ioctl (fd, VT_ACTIVATE, vt_number) < 0) {
+ g_debug ("Gdm: couldn't initiate jump to VT %d: %m",
+ vt_number);
+ } else if (ioctl (fd, VT_WAITACTIVE, vt_number) < 0) {
+ g_debug ("Gdm: couldn't finalize jump to VT %d: %m",
+ vt_number);
+ }
+ close(fd);
+}
+
+
int
main (int argc,
char **argv)
@@ -317,6 +336,7 @@ main (int argc,
GError *error = NULL;
int ret;
gboolean res;
+ gboolean plymouth_running = FALSE;
static gboolean do_timed_exit = FALSE;
static gboolean print_version = FALSE;
static gboolean fatal_warnings = FALSE;
@@ -400,6 +420,8 @@ main (int argc,
g_chdir ("/");
+ plymouth_running = g_access("/run/plymouth/pid", F_OK) == 0;
+
main_loop = g_main_loop_new (NULL, FALSE);
g_unix_signal_add (SIGTERM, on_shutdown_signal_cb, main_loop);
@@ -429,6 +451,11 @@ main (int argc,
g_printerr ("%s\n", error->message);
g_clear_error (&error);
}
+
+ if (plymouth_running) {
+ jump_to_vt (1);
+ }
+
return ret;
}

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jun 27 16:43:48 UTC 2014 - fcrozat@suse.com
- Add gdm-plymouth-vt1.patch: switch back to VT1 when terminating
gdm, if plymouth was running at startup [bnc#881676].
-------------------------------------------------------------------
Mon Jun 23 09:57:12 UTC 2014 - dimstar@opensuse.org

View File

@ -60,6 +60,8 @@ Patch34: gdm-default-wm.patch
Patch35: gdm-xauthlocalhostname.patch
# PATCH-FIX-UPSTREAM gdm-look-at-runlevel.patch bnc540482 bgo599180 vuntz@opensuse.org -- Look at the current runlevel before managing the display again, so we don't do this when shutting down or rebooting
Patch40: gdm-look-at-runlevel.patch
# PATCH-FIX-UPSTREAM gdm-plymouth-vt1.patch bnc#881676 fcrozat@suse.com -- switch to VT1 when quitting if gdm was starting with plymouth running
Patch41: gdm-plymouth-vt1.patch
BuildRequires: check-devel
# needed for directory ownership
BuildRequires: dconf
@ -193,6 +195,7 @@ translation-update-upstream
%patch34 -p1
#patch35 -p1
%patch40 -p1
%patch41 -p1
%build
NOCONFIGURE=1 sh autogen.sh