Merge lp:~muktupavels/lightdm/wayland-on-seat1-test into lp:lightdm

Proposed by Alberts Muktupāvels on 2017-02-05
Status: Work in progress
Proposed branch: lp:~muktupavels/lightdm/wayland-on-seat1-test
Merge into: lp:lightdm
Diff against target: 119 lines (+47/-3)
3 files modified
src/lightdm.c (+4/-1)
src/seat.c (+41/-2)
src/seat.h (+2/-0)
To merge this branch: bzr merge lp:~muktupavels/lightdm/wayland-on-seat1-test
Reviewer Review Type Date Requested Status
LightDM Development Team 2017-02-05 Pending
Review via email: mp+316408@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

2466. By Alberts Muktupāvels on 2017-02-05

Test...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/lightdm.c'
2--- src/lightdm.c 2017-01-26 23:04:52 +0000
3+++ src/lightdm.c 2017-02-05 16:48:56 +0000
4@@ -455,9 +455,12 @@
5
6 if (seat)
7 {
8+ gboolean can_multi_session = login1_seat_get_can_multi_session (login1_seat);
9+
10 set_seat_properties (seat, seat_name);
11+ seat_set_can_multi_session (seat, can_multi_session);
12
13- if (!login1_seat_get_can_multi_session (login1_seat))
14+ if (!can_multi_session)
15 {
16 g_debug ("Seat %s has property CanMultiSession=no", seat_name);
17 /* XXX: uncomment this line after bug #1371250 is closed.
18
19=== modified file 'src/seat.c'
20--- src/seat.c 2016-12-09 00:31:30 +0000
21+++ src/seat.c 2017-02-05 16:48:56 +0000
22@@ -36,6 +36,9 @@
23 /* Configuration for this seat */
24 GHashTable *properties;
25
26+ /* TRUE if CanMultiSession=no */
27+ gboolean can_multi_session;
28+
29 /* TRUE if this seat can run multiple sessions at once */
30 gboolean supports_multi_session;
31
32@@ -187,6 +190,13 @@
33 }
34
35 void
36+seat_set_can_multi_session (Seat *seat, gboolean can_multi_session)
37+{
38+ g_return_if_fail (seat != NULL);
39+ seat->priv->can_multi_session = can_multi_session;
40+}
41+
42+void
43 seat_set_supports_multi_session (Seat *seat, gboolean supports_multi_session)
44 {
45 g_return_if_fail (seat != NULL);
46@@ -439,7 +449,7 @@
47 }
48
49 static void
50-display_server_stopped_cb (DisplayServer *display_server, Seat *seat)
51+seat_stop_display_server (Seat *seat, DisplayServer *display_server, gboolean switch_to_greeter)
52 {
53 const gchar *script;
54 GList *list, *link;
55@@ -489,7 +499,7 @@
56 }
57 g_list_free_full (list, g_object_unref);
58
59- if (!seat->priv->stopping)
60+ if (!seat->priv->stopping && switch_to_greeter)
61 {
62 /* If we were the active session, switch to a greeter */
63 active_session = seat_get_active_session (seat);
64@@ -507,6 +517,12 @@
65 g_object_unref (display_server);
66 }
67
68+static void
69+display_server_stopped_cb (DisplayServer *display_server, Seat *seat)
70+{
71+ seat_stop_display_server (seat, display_server, TRUE);
72+}
73+
74 static gboolean
75 can_share_display_server (Seat *seat, DisplayServer *display_server)
76 {
77@@ -1413,6 +1429,29 @@
78 {
79 if (session_get_is_authenticated (session))
80 {
81+ if (!seat->priv->can_multi_session)
82+ {
83+ GList *display_servers, *link;
84+
85+ l_debug (seat, "CanMultiSession=no, stopping existing display servers");
86+ display_servers = g_list_copy (seat->priv->display_servers);
87+
88+ for (link = display_servers; link; link = link->next)
89+ {
90+ DisplayServer *server = link->data;
91+
92+ if (server == display_server)
93+ continue;
94+
95+ g_signal_handlers_disconnect_matched (server, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, seat);
96+ display_server_stop (server);
97+
98+ seat_stop_display_server (seat, server, FALSE);
99+ }
100+
101+ g_list_free (display_servers);
102+ }
103+
104 l_debug (seat, "Display server ready, running session");
105 run_session (seat, session);
106 }
107
108=== modified file 'src/seat.h'
109--- src/seat.h 2016-06-19 22:43:19 +0000
110+++ src/seat.h 2017-02-05 16:48:56 +0000
111@@ -79,6 +79,8 @@
112
113 const gchar *seat_get_name (Seat *seat);
114
115+void seat_set_can_multi_session (Seat *seat, gboolean can_multi_session);
116+
117 void seat_set_supports_multi_session (Seat *seat, gboolean supports_multi_session);
118
119 void seat_set_share_display_server (Seat *seat, gboolean share_display_server);

Subscribers

People subscribed via source and target branches