Mir

Merge lp:~alan-griffiths/mir/revert-c2238 into lp:mir

Proposed by Alan Griffiths
Status: Rejected
Rejected by: Alan Griffiths
Proposed branch: lp:~alan-griffiths/mir/revert-c2238
Merge into: lp:mir
Diff against target: 156 lines (+31/-21)
4 files modified
include/server/mir/server.h (+4/-1)
server-ABI-sha1sums (+2/-1)
src/server/server.cpp (+1/-0)
tests/acceptance-tests/test_client_surface_visibility.cpp (+24/-19)
To merge this branch: bzr merge lp:~alan-griffiths/mir/revert-c2238
Reviewer Review Type Date Requested Status
Daniel van Vugt Abstain
Alan Griffiths Needs Information
PS Jenkins bot (community) continuous-integration Approve
Mir development team Pending
Review via email: mp+247295@code.launchpad.net

Commit message

shell: republish FocusSetter

Description of the change

shell: republish FocusSetter

I was wrong: this is used by qtmir (but I still want to get rid if it as it still doesn't make sense)

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
Alan Griffiths (alan-griffiths) wrote :

Unless we're planning to release soon I'd prefer not landing this.

C.f. lp:~alan-griffiths/mir/MVC-cleanup-of-FocusSetter/+merge/247054

review: Needs Information
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Confused now.

review: Abstain
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Folks seem happy to press on with the MVC series and hope we don't need this. => Rejected

Unmerged revisions

2249. By Alan Griffiths

merge -r2238..2237 ..

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'include/server/mir/server.h'
--- include/server/mir/server.h 2015-01-19 11:40:40 +0000
+++ include/server/mir/server.h 2015-01-22 14:28:33 +0000
@@ -33,7 +33,7 @@
33namespace input { class CompositeEventFilter; class InputDispatcher; class CursorListener; class TouchVisualizer; }33namespace input { class CompositeEventFilter; class InputDispatcher; class CursorListener; class TouchVisualizer; }
34namespace logging { class Logger; }34namespace logging { class Logger; }
35namespace options { class Option; }35namespace options { class Option; }
36namespace shell { class FocusController; class DisplayLayout; class HostLifecycleEventListener; }36namespace shell { class FocusController; class FocusSetter; class DisplayLayout; class HostLifecycleEventListener; }
37namespace scene37namespace scene
38{38{
39class PlacementStrategy;39class PlacementStrategy;
@@ -241,6 +241,9 @@
241 /// Sets an override functor for creating the session mediator report.241 /// Sets an override functor for creating the session mediator report.
242 void override_the_session_mediator_report(Builder<frontend::SessionMediatorReport> const& session_mediator_builder);242 void override_the_session_mediator_report(Builder<frontend::SessionMediatorReport> const& session_mediator_builder);
243243
244 /// Sets an override functor for creating the shell focus setter.
245 void override_the_shell_focus_setter(Builder<shell::FocusSetter> const& focus_setter_builder);
246
244 /// Sets an override functor for creating the surface configurator.247 /// Sets an override functor for creating the surface configurator.
245 void override_the_surface_configurator(Builder<scene::SurfaceConfigurator> const& surface_configurator_builder);248 void override_the_surface_configurator(Builder<scene::SurfaceConfigurator> const& surface_configurator_builder);
246249
247250
=== renamed file 'src/include/server/mir/shell/focus_setter.h' => 'include/server/mir/shell/focus_setter.h'
=== modified file 'server-ABI-sha1sums'
--- server-ABI-sha1sums 2015-01-22 03:10:13 +0000
+++ server-ABI-sha1sums 2015-01-22 14:28:33 +0000
@@ -101,10 +101,11 @@
101aceccc0bdeea5c90d6c5ea17ed4ce6b5dc1b0ed4 include/server/mir/scene/surface.h101aceccc0bdeea5c90d6c5ea17ed4ce6b5dc1b0ed4 include/server/mir/scene/surface.h
102587e22d751656ce2d9536afdf5659276ff9bbc46 include/server/mir/scene/surface_observer.h102587e22d751656ce2d9536afdf5659276ff9bbc46 include/server/mir/scene/surface_observer.h
1037ef3e99901168cda296d74d05a979f47bf9c3ff1 include/server/mir/server_action_queue.h1037ef3e99901168cda296d74d05a979f47bf9c3ff1 include/server/mir/server_action_queue.h
1049ebaf52d83b27063498eda8481dd4e53213e98f8 include/server/mir/server.h1043f61714a65f816acbd26377e31222c410527753a include/server/mir/server.h
10586098b500339bfccd07a9bed8298f75a68b18f5c include/server/mir/server_status_listener.h10586098b500339bfccd07a9bed8298f75a68b18f5c include/server/mir/server_status_listener.h
106860c04f32b60e680140148dc9dc2295de145b9c1 include/server/mir/shell/display_layout.h106860c04f32b60e680140148dc9dc2295de145b9c1 include/server/mir/shell/display_layout.h
1076a2107b01feae13060d5c305804906e53c52e0be include/server/mir/shell/focus_controller.h1076a2107b01feae13060d5c305804906e53c52e0be include/server/mir/shell/focus_controller.h
108b74342d8ffab489405a4e12fce0c257ac9f8596c include/server/mir/shell/focus_setter.h
108f8d415af54b4a477338fb9dbe20db01aa4544029 include/server/mir/shell/host_lifecycle_event_listener.h109f8d415af54b4a477338fb9dbe20db01aa4544029 include/server/mir/shell/host_lifecycle_event_listener.h
1094f50c37bb8e36a1aa4918af6aa01b0f032ed0984 include/server/mir/shell/input_targeter.h1104f50c37bb8e36a1aa4918af6aa01b0f032ed0984 include/server/mir/shell/input_targeter.h
110a46723e246b4cb6619cf8abbedb02c3391f563c9 include/server/mir/shell/session_coordinator_wrapper.h111a46723e246b4cb6619cf8abbedb02c3391f563c9 include/server/mir/shell/session_coordinator_wrapper.h
111112
=== modified file 'src/server/server.cpp'
--- src/server/server.cpp 2015-01-19 11:40:40 +0000
+++ src/server/server.cpp 2015-01-22 14:28:33 +0000
@@ -61,6 +61,7 @@
61 MACRO(session_authorizer)\61 MACRO(session_authorizer)\
62 MACRO(session_listener)\62 MACRO(session_listener)\
63 MACRO(session_mediator_report)\63 MACRO(session_mediator_report)\
64 MACRO(shell_focus_setter)\
64 MACRO(surface_configurator)65 MACRO(surface_configurator)
6566
66#define FOREACH_ACCESSOR(MACRO)\67#define FOREACH_ACCESSOR(MACRO)\
6768
=== modified file 'tests/acceptance-tests/test_client_surface_visibility.cpp'
--- tests/acceptance-tests/test_client_surface_visibility.cpp 2015-01-19 12:32:12 +0000
+++ tests/acceptance-tests/test_client_surface_visibility.cpp 2015-01-22 14:28:33 +0000
@@ -20,6 +20,7 @@
2020
21#include "mir/scene/surface.h"21#include "mir/scene/surface.h"
22#include "mir/shell/surface_coordinator_wrapper.h"22#include "mir/shell/surface_coordinator_wrapper.h"
23#include "mir/shell/focus_setter.h"
2324
24#include "mir_test_framework/connected_client_with_a_surface.h"25#include "mir_test_framework/connected_client_with_a_surface.h"
25#include "mir_test/wait_condition.h"26#include "mir_test/wait_condition.h"
@@ -39,6 +40,7 @@
3940
40namespace41namespace
41{42{
43
42class StoringSurfaceCoordinator : public msh::SurfaceCoordinatorWrapper44class StoringSurfaceCoordinator : public msh::SurfaceCoordinatorWrapper
43{45{
44public:46public:
@@ -58,17 +60,6 @@
58 return surfaces[index].lock();60 return surfaces[index].lock();
59 }61 }
6062
61 void raise(std::weak_ptr<ms::Surface> const& /*surface*/) override
62 {
63 // We get some racy "raise" requests from the DefaultFocusManagement
64 // so we ignore any raise requests that we don't issue ourselves
65 }
66
67 void raise(int index)
68 {
69 msh::SurfaceCoordinatorWrapper::raise(surface(index));
70 }
71
72private:63private:
73 std::vector<std::weak_ptr<ms::Surface>> surfaces;64 std::vector<std::weak_ptr<ms::Surface>> surfaces;
7465
@@ -97,12 +88,24 @@
9788
98 void SetUp() override89 void SetUp() override
99 {90 {
100 server.wrap_surface_coordinator([&]91 server.wrap_surface_coordinator([]
101 (std::shared_ptr<ms::SurfaceCoordinator> const& wrapped)92 (std::shared_ptr<ms::SurfaceCoordinator> const& wrapped)
102 {93 {
103 auto const result = std::make_shared<StoringSurfaceCoordinator>(wrapped);94 return std::make_shared<StoringSurfaceCoordinator>(wrapped);
104 storing_surface_coordinator = result;95 });
105 return result;96
97 /*
98 * Use a null focus setter so that it doesn't change the surface
99 * order and introduce races to our tests.
100 */
101 server.override_the_shell_focus_setter([]
102 {
103 struct NullFocusSetter : msh::FocusSetter
104 {
105 void set_focus_to(std::shared_ptr<ms::Session> const&) override {}
106 };
107
108 return std::make_shared<NullFocusSetter>();
106 });109 });
107110
108 mtf::ConnectedClientWithASurface::SetUp();111 mtf::ConnectedClientWithASurface::SetUp();
@@ -134,14 +137,17 @@
134 137
135 mir_surface_spec_release(spec);138 mir_surface_spec_release(spec);
136139
137 storing_surface_coordinator.lock()->raise(1);140 server.the_surface_coordinator()->raise(server_surface(1));
138141
139 mir_surface_swap_buffers_sync(second_surface);142 mir_surface_swap_buffers_sync(second_surface);
140 }143 }
141144
142 std::shared_ptr<ms::Surface> server_surface(size_t index)145 std::shared_ptr<ms::Surface> server_surface(size_t index)
143 {146 {
144 return storing_surface_coordinator.lock()->surface(index);147 auto const storing_surface_coordinator =
148 std::dynamic_pointer_cast<StoringSurfaceCoordinator>(server.the_surface_coordinator());
149
150 return storing_surface_coordinator->surface(index);
145 }151 }
146152
147 void move_surface_off_screen()153 void move_surface_off_screen()
@@ -156,7 +162,7 @@
156162
157 void raise_surface_on_top()163 void raise_surface_on_top()
158 {164 {
159 storing_surface_coordinator.lock()->raise(0);165 server.the_surface_coordinator()->raise(server_surface(0));
160 }166 }
161167
162 void expect_surface_visibility_event_after(168 void expect_surface_visibility_event_after(
@@ -184,7 +190,6 @@
184190
185 MirSurface* second_surface = nullptr;191 MirSurface* second_surface = nullptr;
186 testing::NiceMock<MockVisibilityCallback> mock_visibility_callback;192 testing::NiceMock<MockVisibilityCallback> mock_visibility_callback;
187 std::weak_ptr<StoringSurfaceCoordinator> storing_surface_coordinator;
188};193};
189194
190}195}

Subscribers

People subscribed via source and target branches