diff -up kdebase-workspace-4.4.92/kdm/backend/dm.c.kdm_plymouth kdebase-workspace-4.4.92/kdm/backend/dm.c --- kdebase-workspace-4.4.92/kdm/backend/dm.c.kdm_plymouth 2010-07-06 01:54:30.000000000 -0500 +++ kdebase-workspace-4.4.92/kdm/backend/dm.c 2010-07-07 14:01:03.867921854 -0500 @@ -1329,6 +1329,36 @@ getBusyVTs(void) return activeVTs; } +static int +get_active_vt (void) +{ + int console_fd; + struct vt_stat console_state = { 0 }; + console_fd = open ("/dev/tty0", O_RDONLY | O_NOCTTY); + if (console_fd < 0) { + goto out; + } + if (ioctl (console_fd, VT_GETSTATE, &console_state) < 0) { + goto out; + } +out: + if (console_fd >= 0) { + close (console_fd); + } + return console_state.v_active; +} + +static int +triggered_to_force_display_on_active_vt (void) +{ + int should_force_display_on_active_vt; + should_force_display_on_active_vt=open("/var/spool/gdm/force-display-on-active-vt", O_RDONLY); + if ( should_force_display_on_active_vt >= 0 ) + close(should_force_display_on_active_vt); + unlink("/var/spool/gdm/force-display-on-active-vt"); + return should_force_display_on_active_vt; +} + static void allocateVT(struct display *d) { @@ -1338,6 +1368,14 @@ allocateVT(struct display *d) if ((d->displayType & d_location) == dLocal && d->status == notRunning && !d->serverVT && d->reqSrvVT >= 0) { + if ( triggered_to_force_display_on_active_vt() >= 0 ) { + int vt; + vt = get_active_vt(); + if (vt > 0) { + d->serverVT = vt; + return; + } + } if (d->reqSrvVT && d->reqSrvVT < 16) { d->serverVT = d->reqSrvVT; } else {