SHA256
1
0
forked from pool/gdm
gdm/gdm-look-at-runlevel.patch
Vincent Untz a16ea7f61e Accepting request 25659 from home:vuntz:branches:GNOME:Factory
Copy from home:vuntz:branches:GNOME:Factory/gdm via accept of submit request 25659 revision 3.
Request was accepted with message:
Accepting

OBS-URL: https://build.opensuse.org/request/show/25659
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gdm?expand=0&rev=106
2009-12-04 22:47:18 +00:00

58 lines
1.6 KiB
Diff

Index: gdm-2.28.0/daemon/gdm-static-display.c
===================================================================
--- gdm-2.28.0.orig/daemon/gdm-static-display.c
+++ gdm-2.28.0/daemon/gdm-static-display.c
@@ -26,6 +26,7 @@
#include <fcntl.h>
#include <pwd.h>
#include <unistd.h>
+#include <utmp.h>
#include <string.h>
#include <signal.h>
#include <sys/stat.h>
@@ -96,6 +97,29 @@ gdm_static_display_manage (GdmDisplay *d
}
static gboolean
+gdm_static_display_should_manage_again (void)
+{
+ struct utmp *ut;
+
+ setutent();
+ while ((ut = getutent()) != NULL) {
+ if (ut->ut_type == RUN_LVL) {
+ char current;
+ current = ut->ut_pid % 256;
+ endutent();
+
+ if (current == '0' || current == '6')
+ return FALSE;
+ return TRUE;
+ }
+ }
+
+ endutent();
+
+ return TRUE;
+}
+
+static gboolean
gdm_static_display_finish (GdmDisplay *display)
{
int status;
@@ -108,9 +132,11 @@ gdm_static_display_finish (GdmDisplay *d
/* restart static displays */
gdm_display_unmanage (display);
- status = gdm_display_get_status (display);
- if (status != GDM_DISPLAY_FAILED) {
- gdm_display_manage (display);
+ if (gdm_static_display_should_manage_again ()) {
+ status = gdm_display_get_status (display);
+ if (status != GDM_DISPLAY_FAILED) {
+ gdm_display_manage (display);
+ }
}
return TRUE;