Merge lp:~mterry/unity-system-compositor/set-next-session into lp:unity-system-compositor

Proposed by Michael Terry
Status: Merged
Approved by: Robert Ancell
Approved revision: 39
Merged at revision: 52
Proposed branch: lp:~mterry/unity-system-compositor/set-next-session
Merge into: lp:unity-system-compositor
Diff against target: 97 lines (+33/-2)
4 files modified
src/dm_connection.cpp (+10/-0)
src/dm_connection.h (+4/-1)
src/system_compositor.cpp (+18/-1)
src/system_compositor.h (+1/-0)
To merge this branch: bzr merge lp:~mterry/unity-system-compositor/set-next-session
Reviewer Review Type Date Requested Status
Robert Ancell Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+181325@code.launchpad.net

Commit message

Add the API needed for LightDM to be able to set the 'next session' (but leave actually implementing the API to later).

Description of the change

Add the API needed for LightDM to be able to set the 'next session' (but leave actually implementing the API to later).

The 'next session' is the user session that LightDM wants displayed beneath the greeter. An in-the-batter-box session.

This does not do implementation yet, since I'm not sure exactly what that code will be. It will likely look like an overrided surface_builder that sets DepthIds for its surfaces based on the owning session name. The greeter will be in a separate DepthId from all the user sessions. Then when we get a 'set-next-session' request, we can just float the matching session to the top of its DepthId.

But since Mir-on-Mir isn't working, I can't really test that. So here's this branch at least to lock in the API for LightDM so we can land that side of things before FF.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/dm_connection.cpp'
2--- src/dm_connection.cpp 2013-06-11 00:39:33 +0000
3+++ src/dm_connection.cpp 2013-08-21 15:02:26 +0000
4@@ -90,6 +90,16 @@
5 handler->set_active_session(client_name);
6 break;
7 }
8+ case USCMessageID::set_next_session:
9+ {
10+ std::ostringstream ss;
11+ ss << &message_payload_buffer;
12+ auto client_name = ss.str();
13+ std::cerr << "set_next_session '" << client_name << "'" << std::endl;
14+ if (handler)
15+ handler->set_next_session(client_name);
16+ break;
17+ }
18 default:
19 std::cerr << "Ignoring unknown message " << (uint16_t) message_id << " with " << payload_length << " octets" << std::endl;
20 break;
21
22=== modified file 'src/dm_connection.h'
23--- src/dm_connection.h 2013-04-26 04:30:42 +0000
24+++ src/dm_connection.h 2013-08-21 15:02:26 +0000
25@@ -25,12 +25,14 @@
26 {
27 public:
28 virtual void set_active_session(std::string client_name) = 0;
29+ virtual void set_next_session(std::string client_name) = 0;
30 };
31
32 class NullDMMessageHandler : public DMMessageHandler
33 {
34 public:
35 void set_active_session(std::string client_name) {};
36+ void set_next_session(std::string client_name) {};
37 };
38
39 enum class USCMessageID
40@@ -39,7 +41,8 @@
41 pong = 1,
42 ready = 2,
43 session_connected = 3,
44- set_active_session = 4
45+ set_active_session = 4,
46+ set_next_session = 5,
47 };
48
49 class DMConnection
50
51=== modified file 'src/system_compositor.cpp'
52--- src/system_compositor.cpp 2013-07-10 17:16:32 +0000
53+++ src/system_compositor.cpp 2013-08-21 15:02:26 +0000
54@@ -41,7 +41,7 @@
55 add_options()
56 ("from-dm-fd", po::value<int>(), "File descriptor of read end of pipe from display manager [int]")
57 ("to-dm-fd", po::value<int>(), "File descriptor of write end of pipe to display manager [int]");
58- add_options()
59+ add_options()
60 ("version", "Show version of Unity System Compositor");
61 }
62
63@@ -117,6 +117,23 @@
64 std::cerr << "Unable to set active session, unknown client name " << client_name << std::endl;
65 }
66
67+void SystemCompositor::set_next_session(std::string client_name)
68+{
69+ std::cerr << "set_next_session" << std::endl;
70+
71+ std::shared_ptr<msh::Session> session;
72+ config->the_shell_session_container()->for_each([&client_name, &session](std::shared_ptr<msh::Session> const& s)
73+ {
74+ if (s->name() == client_name)
75+ session = s;
76+ });
77+
78+ if (session)
79+ ; // TODO: implement this
80+ else
81+ std::cerr << "Unable to set next session, unknown client name " << client_name << std::endl;
82+}
83+
84 void SystemCompositor::main()
85 {
86 dm_connection->set_handler(this);
87
88=== modified file 'src/system_compositor.h'
89--- src/system_compositor.h 2013-06-20 08:29:14 +0000
90+++ src/system_compositor.h 2013-08-21 15:02:26 +0000
91@@ -36,6 +36,7 @@
92 std::shared_ptr<DMConnection> dm_connection;
93
94 virtual void set_active_session(std::string client_name);
95+ virtual void set_next_session(std::string client_name);
96 void main();
97 };
98

Subscribers

People subscribed via source and target branches