1 diff -up kdebase-workspace-4.4.92/kdm/backend/dm.c.kdm_plymouth kdebase-workspace-4.4.92/kdm/backend/dm.c
2 --- kdebase-workspace-4.4.92/kdm/backend/dm.c.kdm_plymouth 2010-07-06 01:54:30.000000000 -0500
3 +++ kdebase-workspace-4.4.92/kdm/backend/dm.c 2010-07-07 13:55:48.425171749 -0500
4 @@ -1329,6 +1329,81 @@ getBusyVTs(void)
12 + struct vt_stat console_state = { 0 };
13 + console_fd = open ("/dev/tty0", O_RDONLY | O_NOCTTY);
14 + if (console_fd < 0) {
17 + if (ioctl (console_fd, VT_GETSTATE, &console_state) < 0) {
21 + if (console_fd >= 0) {
24 + return console_state.v_active;
28 +plymouth_is_running (void)
31 + status = system ("/bin/plymouth --ping");
33 + return WIFEXITED (status) && WEXITSTATUS (status) == 0;
37 +plymouth_has_active_vt (void)
40 + status = system ("/bin/plymouth --has-active-vt");
42 + return WIFEXITED (status) && WEXITSTATUS (status) == 0;
46 +plymouth_prepare_for_transition (void)
49 + status = system ("/bin/plymouth deactivate");
51 + return WIFEXITED (status) && WEXITSTATUS (status) == 0;
55 +plymouth_quit_with_transition (void)
58 + status = system ("/bin/plymouth quit --retain-splash");
60 + return WIFEXITED (status) && WEXITSTATUS (status) == 0;
64 +plymouth_quit_without_transition (void)
67 + status = system ("/bin/plymouth quit");
69 + return WIFEXITED (status) && WEXITSTATUS (status) == 0;
73 +triggered_to_force_display_on_active_vt (void)
75 + int should_force_display_on_active_vt;
76 + should_force_display_on_active_vt=open("/var/spool/gdm/force-display-on-active-vt", O_RDONLY);
77 + if ( should_force_display_on_active_vt >= 0 )
78 + close(should_force_display_on_active_vt);
79 + unlink("/var/spool/gdm/force-display-on-active-vt");
80 + return should_force_display_on_active_vt;
84 allocateVT(struct display *d)
86 @@ -1338,6 +1413,43 @@ allocateVT(struct display *d)
87 if ((d->displayType & d_location) == dLocal &&
88 d->status == notRunning && !d->serverVT && d->reqSrvVT >= 0)
90 + /* check for plymouth using newer methods */
91 + d->plymouth_is_running = plymouth_is_running ();
92 + if (d->plymouth_is_running) {
93 + /* call plymouth deactivate */
94 + plymouth_prepare_for_transition ();
95 + if (plymouth_has_active_vt ()) {
96 + /* plymouth was displaying a splash screen and has
97 + * terminated leaving it on screen
100 + vt = get_active_vt ();
102 + /* start the X server on the active vt */
108 + /* plymouth might have been running but did not display
112 + /* call plymouth quit and start the X server as usual */
113 + d->plymouth_is_running = !plymouth_quit_without_transition ();
116 + /* fallback to old/deprecated method */
117 + } else if ( triggered_to_force_display_on_active_vt() >= 0 ) {
119 + vt = get_active_vt();
127 if (d->reqSrvVT && d->reqSrvVT < 16) {
128 d->serverVT = d->reqSrvVT;
130 diff -up kdebase-workspace-4.4.92/kdm/backend/dm.h.kdm_plymouth kdebase-workspace-4.4.92/kdm/backend/dm.h
131 --- kdebase-workspace-4.4.92/kdm/backend/dm.h.kdm_plymouth 2010-07-06 01:54:30.000000000 -0500
132 +++ kdebase-workspace-4.4.92/kdm/backend/dm.h 2010-07-07 13:48:11.874921158 -0500
133 @@ -292,6 +292,8 @@ struct display {
134 int authNum; /* number of authorizations */
135 char *authFile; /* file to store authorization in */
136 char *greeterAuthFile; /* file to store authorization for greeter in */
138 + int plymouth_is_running; /* Plymouth's status */
142 @@ -404,6 +406,8 @@ int anyDisplaysLeft(void);
143 void forEachDisplay(void (*f)(struct display *));
145 void forEachDisplayRev(void (*f)(struct display *));
146 +/* function for plymouth */
147 +int plymouth_quit_with_transition (void);
149 void removeDisplay(struct display *old);
151 diff -up kdebase-workspace-4.4.92/kdm/backend/server.c.kdm_plymouth kdebase-workspace-4.4.92/kdm/backend/server.c
152 --- kdebase-workspace-4.4.92/kdm/backend/server.c.kdm_plymouth 2010-07-06 01:54:30.000000000 -0500
153 +++ kdebase-workspace-4.4.92/kdm/backend/server.c 2010-07-07 13:56:46.960921366 -0500
154 @@ -137,6 +137,11 @@ startServerSuccess()
155 struct display *d = startingServer;
156 d->serverStatus = ignore;
157 serverTimeout = TO_INF;
158 + if (d->plymouth_is_running) {
159 + debug( "Quitting Plymouth with transition\n" );
160 + d->plymouth_is_running = !plymouth_quit_with_transition ();
161 + debug ("Is Plymouth still running? %s\n", d->plymouth_is_running ? "yes" : "no");
163 debug("X server ready, starting session\n");