summaryrefslogtreecommitdiffstats
path: root/src/ck-manager.c
diff options
context:
space:
mode:
authorWilliam Jon McCann <mccann@jhu.edu>2007-03-06 00:25:06 -0500
committerWilliam Jon McCann <mccann@jhu.edu>2007-03-06 00:25:06 -0500
commitd9ca86ae5acb8a4a56e875c9ad0ed617f50abf65 (patch)
tree58729d02c63e2c2f9ce64576681f05d8691f3c42 /src/ck-manager.c
parenta3cb617b1fd3be5199c0dfc08aee0af4b04d1a8b (diff)
use a slightly more sophisticated rule for adding sessions to static seat
Diffstat (limited to 'src/ck-manager.c')
-rw-r--r--src/ck-manager.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/src/ck-manager.c b/src/ck-manager.c
index 8e0304c..6a4c75b 100644
--- a/src/ck-manager.c
+++ b/src/ck-manager.c
@@ -319,19 +319,46 @@ find_seat_for_session (CkManager *manager,
CkSession *session)
{
CkSeat *seat;
- gboolean is_static;
+ gboolean is_static_x11;
+ gboolean is_static_text;
+ char *display_device;
+ char *x11_display_device;
+ char *x11_display;
+ char *remote_host_name;
gboolean is_local;
+ is_static_text = FALSE;
+ is_static_x11 = FALSE;
+
seat = NULL;
- is_local = TRUE;
+ display_device = NULL;
+ x11_display_device = NULL;
+ x11_display = NULL;
+ remote_host_name = NULL;
+ is_local = FALSE;
/* FIXME: use matching to group entries? */
- /* for now group all local entries */
+ ck_session_get_display_device (session, &display_device, NULL);
+ ck_session_get_x11_display_device (session, &x11_display_device, NULL);
+ ck_session_get_x11_display (session, &x11_display, NULL);
+ ck_session_get_remote_host_name (session, &remote_host_name, NULL);
ck_session_is_local (session, &is_local, NULL);
- is_static = is_local;
- if (is_static) {
+ if (x11_display != NULL
+ && x11_display_device != NULL
+ && remote_host_name == NULL
+ && is_local == TRUE) {
+ is_static_x11 = TRUE;
+ } else if (x11_display == NULL
+ && x11_display_device == NULL
+ && display_device != NULL
+ && remote_host_name == NULL
+ && is_local == TRUE) {
+ is_static_text = TRUE;
+ }
+
+ if (is_static_x11 || is_static_text) {
char *sid;
sid = g_strdup_printf ("%s/Seat%u", CK_DBUS_PATH, 1);
seat = g_hash_table_lookup (manager->priv->seats, sid);