From 5f5bafef16b9ad9c1d4c672c14eb7bb2e5c954a5 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Tue, 30 Jul 2013 17:43:48 +0400 Subject: consolekit (0.4.6-2+dyson1) unstable; urgency=low * Package for Dyson * Added build-dep: libscf-dev [illumos-any] * Refresh dbus in postinst * Use pkill in consolekit.prerm (depends on procutils | procps) * Added solaris patches: solaris/ConsoleKit-01-ck-dynamic.diff solaris/ConsoleKit-02-add-sunray-type.diff solaris/ConsoleKit-03-sol-novt.diff solaris/ConsoleKit-06-ck-history.diff solaris/ConsoleKit-07-suppress-warning.diff solaris/ConsoleKit-08-vt-switch.diff --- .../patches/solaris/ConsoleKit-08-vt-switch.diff | 108 +++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 debian/patches/solaris/ConsoleKit-08-vt-switch.diff (limited to 'debian/patches/solaris/ConsoleKit-08-vt-switch.diff') diff --git a/debian/patches/solaris/ConsoleKit-08-vt-switch.diff b/debian/patches/solaris/ConsoleKit-08-vt-switch.diff new file mode 100644 index 0000000..6b482dd --- /dev/null +++ b/debian/patches/solaris/ConsoleKit-08-vt-switch.diff @@ -0,0 +1,108 @@ +Index: consolekit/src/ck-seat.c +=================================================================== +--- consolekit.orig/src/ck-seat.c 2013-07-30 17:35:46.031481292 +0400 ++++ consolekit/src/ck-seat.c 2013-07-30 17:35:47.628494929 +0400 +@@ -962,9 +962,32 @@ + ck_session_is_open (value, &is_open, NULL); + + if (is_open) { ++ GError *vt_error = NULL; ++ char *device; ++ guint num; ++ gboolean ret; ++ + login_session = NULL; +- change_active_session (seat, value); +- break; ++ ++ g_debug ("Found open session."); ++ ++ switch (seat->priv->kind) { ++ case CK_SEAT_KIND_STATIC: ++ device = NULL; ++ ck_session_get_x11_display_device (value, &device, NULL); ++ ++ if (device != NULL) { ++ ret = ck_get_console_num_from_device (device, &num); ++ if (ret) { ++ g_debug ("Activating VT %d", num); ++ ck_vt_monitor_set_active (seat->priv->vt_monitor, num, &vt_error); ++ } ++ } ++ break; ++ case CK_SEAT_KIND_DYNAMIC: ++ change_active_session (seat, value); ++ break; ++ } + } + + ck_session_get_session_type (value, &session_type, NULL); +@@ -1054,6 +1077,11 @@ + CkSession *orig_session; + gboolean res; + gboolean ret; ++ GHashTableIter iter; ++ gpointer key, value; ++ gboolean found_login = FALSE; ++ gboolean is_open; ++ char *session_type = NULL; + + g_return_val_if_fail (CK_IS_SEAT (seat), FALSE); + +@@ -1093,7 +1121,46 @@ + g_signal_emit (seat, signals [SESSION_REMOVED], 0, ssid); + + /* try to change the active session */ +- maybe_update_active_session (seat); ++ ++ /* On session exit, first try to switch to any active login sessions */ ++ g_hash_table_iter_init (&iter, seat->priv->sessions); ++ if (seat->priv->kind == CK_SEAT_KIND_STATIC) { ++ while (seat->priv->kind == CK_SEAT_KIND_STATIC && g_hash_table_iter_next (&iter, &key, &value)) { ++ CkSession *login_session = value; ++ ck_session_get_session_type (login_session, &session_type, NULL); ++ ck_session_is_open (login_session, &is_open, NULL); ++ ++ if (is_open && IS_STR_SET (session_type) && ++ g_str_equal (session_type, "LoginWindow")) { ++ GError *vt_error = NULL; ++ char *device; ++ guint num; ++ ++ g_debug ("Found a LoginWindow"); ++ device = NULL; ++ ck_session_get_x11_display_device (login_session, &device, NULL); ++ ++ if (device != NULL) { ++ ret = ck_get_console_num_from_device (device, &num); ++ if (ret) { ++ g_debug ("Setting active to %d", num); ++ found_login = TRUE; ++ ck_vt_monitor_set_active (seat->priv->vt_monitor, num, &vt_error); ++ } else { ++ g_debug ("The LoginWindow device has no console number, not using."); ++ } ++ } else { ++ g_debug ("The LoginWindow display has no x11 display device, not using."); ++ } ++ } ++ if (session_type != NULL) ++ g_free (session_type); ++ } ++ } ++ ++ /* Otherwise, look for an active session */ ++ if (found_login == FALSE) ++ maybe_update_active_session (seat); + + if (orig_session != NULL) { + g_object_unref (orig_session); +@@ -1359,8 +1426,6 @@ + CkSeat *seat) + { + g_debug ("Active vt changed: %u", num); +- +- update_active_vt (seat, num); + } + + gboolean -- cgit v1.2.3