Mir

Merge lp:~mterry/mir/no-nested-display-config into lp:mir/0.1

Proposed by Michael Terry
Status: Work in progress
Proposed branch: lp:~mterry/mir/no-nested-display-config
Merge into: lp:mir/0.1
Diff against target: 58 lines (+14/-3)
2 files modified
src/server/graphics/nested/nested_display.cpp (+12/-3)
src/server/graphics/nested/nested_display.h (+2/-0)
To merge this branch: bzr merge lp:~mterry/mir/no-nested-display-config
Reviewer Review Type Date Requested Status
Mir development team Pending
Review via email: mp+214979@code.launchpad.net

Commit message

Bandaid for greeter turning screen on.

Description of the change

(This is just a port of https://code.launchpad.net/~andreas-pokorny/mir/no-initial-display-configuration-sent-to-hosting-server/+merge/213126 to lp:mir)

Workaround for Greeter turning the screen on.

This is just a workaround for the issue with the split greeter. While display is off another greeter is spawned to be shown as soon as display is turned on again. A greeter is a nested mir server. On initialization nested servers send the initial display configuration to the hosting server. Obviously that configuration contains power_mode == MirPowerMode::mir_power_mode_on.
u-s-c sets the focus onto the recently started greeter as soon as the session has a surface with buffers in. On that focus change the the stored display configuration (given they have one) is applied. Which turns the display on.

This change disables sending the first/initial nested display configuration.
We clearly need a better solution for that issue so we can remove that workaround as soon as we have one.

To post a comment you must log in.

Unmerged revisions

1183. By Michael Terry

Port Andreas Pokorny's patch from devel to trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/server/graphics/nested/nested_display.cpp'
2--- src/server/graphics/nested/nested_display.cpp 2014-03-17 07:35:22 +0000
3+++ src/server/graphics/nested/nested_display.cpp 2014-04-09 15:36:26 +0000
4@@ -137,10 +137,9 @@
5 egl_display{*connection},
6 outputs{}
7 {
8-
9 std::shared_ptr<DisplayConfiguration> conf(configuration());
10 initial_conf_policy->apply_to(*conf);
11- configure(*conf);
12+ create_surfaces(*conf);
13 }
14
15 mgn::NestedDisplay::~NestedDisplay() noexcept
16@@ -173,6 +172,12 @@
17
18 void mgn::NestedDisplay::configure(mg::DisplayConfiguration const& configuration)
19 {
20+ create_surfaces(configuration);
21+ apply_to_connection(configuration);
22+}
23+
24+void mgn::NestedDisplay::create_surfaces(mg::DisplayConfiguration const& configuration)
25+{
26 if (!configuration.valid())
27 {
28 BOOST_THROW_EXCEPTION(std::logic_error("Invalid or inconsistent display configuration"));
29@@ -224,12 +229,16 @@
30 if (result.empty())
31 BOOST_THROW_EXCEPTION(std::runtime_error("Nested Mir needs at least one output for display"));
32
33- auto const& conf = dynamic_cast<NestedDisplayConfiguration const&>(configuration);
34
35 {
36 std::unique_lock<std::mutex> lock(outputs_mutex);
37 outputs.swap(result);
38 }
39+}
40+
41+void mgn::NestedDisplay::apply_to_connection(mg::DisplayConfiguration const& configuration)
42+{
43+ auto const& conf = dynamic_cast<NestedDisplayConfiguration const&>(configuration);
44
45 mir_connection_apply_display_config(*connection, conf);
46 }
47
48=== modified file 'src/server/graphics/nested/nested_display.h'
49--- src/server/graphics/nested/nested_display.h 2014-03-06 06:05:17 +0000
50+++ src/server/graphics/nested/nested_display.h 2014-04-09 15:36:26 +0000
51@@ -129,6 +129,8 @@
52 std::mutex outputs_mutex;
53 std::unordered_map<DisplayConfigurationOutputId, std::shared_ptr<detail::NestedOutput>> outputs;
54 DisplayConfigurationChangeHandler my_conf_change_handler;
55+ void create_surfaces(mir::graphics::DisplayConfiguration const& configuration);
56+ void apply_to_connection(mir::graphics::DisplayConfiguration const& configuration);
57 void complete_display_initialization(MirPixelFormat format);
58 };
59

Subscribers

People subscribed via source and target branches