From c2e317911f2fae424ec9a121f267e4a83efcf1c5 Mon Sep 17 00:00:00 2001 From: Halton Huo Date: Wed, 19 May 2010 12:46:25 +0800 Subject: [PATCH] Enhancement CanActivateSessions for OpenSolaris. VT switching is always enabled on Linux, but for OpenSolaris VT switching can be truned of by 'svcadm disable vtdaemon'. So we should also check whether the service vtdaemon is online on OpenSolaris. https://bugs.freedesktop.org/show_bug.cgi?id=26055 --- src/Makefile.am | 1 + src/ck-sysdeps-freebsd.c | 6 ++++++ src/ck-sysdeps-linux.c | 6 ++++++ src/ck-sysdeps-solaris.c | 18 ++++++++++++++++++ src/ck-sysdeps.h | 1 + 5 files changed, 32 insertions(+), 0 deletions(-) diff --git a/src/ck-sysdeps-linux.c b/src/ck-sysdeps-linux.c index 09db310..a95272e 100644 --- a/src/ck-sysdeps-linux.c +++ b/src/ck-sysdeps-linux.c @@ -693,6 +693,12 @@ ck_get_max_num_consoles (guint *num) return TRUE; } +gboolean +ck_supports_activatable_consoles (void) +{ + return TRUE; +} + char * ck_get_console_device_for_num (guint num) { --- ConsoleKit-0.4.1/src/ck-seat.c-orig 2011-02-07 22:09:46.085393510 -0600 +++ ConsoleKit-0.4.1/src/ck-seat.c 2011-02-07 22:10:58.766029875 -0600 @@ -1172,6 +1172,10 @@ ck_seat_can_activate_sessions (CkSeat { g_return_val_if_fail (CK_IS_SEAT (seat), FALSE); + if (ck_supports_activatable_consoles () == FALSE) { + return FALSE; + } + if (can_activate != NULL) { *can_activate = (seat->priv->kind == CK_SEAT_KIND_STATIC); }