mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-25 02:52:13 +08:00
54 lines
1.7 KiB
Plaintext
54 lines
1.7 KiB
Plaintext
diff -up kdebase-workspace-4.3.4/kdm/backend/dm.c.kdm_plymouth kdebase-workspace-4.3.4/kdm/backend/dm.c
|
|
--- kdebase-workspace-4.3.4/kdm/backend/dm.c.kdm_plymouth 2008-07-21 19:03:20.000000000 -0500
|
|
+++ kdebase-workspace-4.3.4/kdm/backend/dm.c 2010-01-19 07:32:13.000000000 -0600
|
|
@@ -1315,6 +1315,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 )
|
|
{
|
|
@@ -1324,7 +1354,11 @@ allocateVT( struct display *d )
|
|
if ((d->displayType & d_location) == dLocal &&
|
|
d->status == notRunning && !d->serverVT && d->reqSrvVT >= 0)
|
|
{
|
|
- if (d->reqSrvVT && d->reqSrvVT < 16)
|
|
+ if ( triggered_to_force_display_on_active_vt() >= 0 )
|
|
+ {
|
|
+ d->serverVT = get_active_vt() ;
|
|
+ }
|
|
+ else if (d->reqSrvVT && d->reqSrvVT < 16)
|
|
d->serverVT = d->reqSrvVT;
|
|
else {
|
|
for (i = tvt = 0;;) {
|