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
1=== modified file 'include/server/mir/server.h'
2--- include/server/mir/server.h 2015-01-19 11:40:40 +0000
3+++ include/server/mir/server.h 2015-01-22 14:28:33 +0000
4@@ -33,7 +33,7 @@
5 namespace input { class CompositeEventFilter; class InputDispatcher; class CursorListener; class TouchVisualizer; }
6 namespace logging { class Logger; }
7 namespace options { class Option; }
8-namespace shell { class FocusController; class DisplayLayout; class HostLifecycleEventListener; }
9+namespace shell { class FocusController; class FocusSetter; class DisplayLayout; class HostLifecycleEventListener; }
10 namespace scene
11 {
12 class PlacementStrategy;
13@@ -241,6 +241,9 @@
14 /// Sets an override functor for creating the session mediator report.
15 void override_the_session_mediator_report(Builder<frontend::SessionMediatorReport> const& session_mediator_builder);
16
17+ /// Sets an override functor for creating the shell focus setter.
18+ void override_the_shell_focus_setter(Builder<shell::FocusSetter> const& focus_setter_builder);
19+
20 /// Sets an override functor for creating the surface configurator.
21 void override_the_surface_configurator(Builder<scene::SurfaceConfigurator> const& surface_configurator_builder);
22
23
24=== renamed file 'src/include/server/mir/shell/focus_setter.h' => 'include/server/mir/shell/focus_setter.h'
25=== modified file 'server-ABI-sha1sums'
26--- server-ABI-sha1sums 2015-01-22 03:10:13 +0000
27+++ server-ABI-sha1sums 2015-01-22 14:28:33 +0000
28@@ -101,10 +101,11 @@
29 aceccc0bdeea5c90d6c5ea17ed4ce6b5dc1b0ed4 include/server/mir/scene/surface.h
30 587e22d751656ce2d9536afdf5659276ff9bbc46 include/server/mir/scene/surface_observer.h
31 7ef3e99901168cda296d74d05a979f47bf9c3ff1 include/server/mir/server_action_queue.h
32-9ebaf52d83b27063498eda8481dd4e53213e98f8 include/server/mir/server.h
33+3f61714a65f816acbd26377e31222c410527753a include/server/mir/server.h
34 86098b500339bfccd07a9bed8298f75a68b18f5c include/server/mir/server_status_listener.h
35 860c04f32b60e680140148dc9dc2295de145b9c1 include/server/mir/shell/display_layout.h
36 6a2107b01feae13060d5c305804906e53c52e0be include/server/mir/shell/focus_controller.h
37+b74342d8ffab489405a4e12fce0c257ac9f8596c include/server/mir/shell/focus_setter.h
38 f8d415af54b4a477338fb9dbe20db01aa4544029 include/server/mir/shell/host_lifecycle_event_listener.h
39 4f50c37bb8e36a1aa4918af6aa01b0f032ed0984 include/server/mir/shell/input_targeter.h
40 a46723e246b4cb6619cf8abbedb02c3391f563c9 include/server/mir/shell/session_coordinator_wrapper.h
41
42=== modified file 'src/server/server.cpp'
43--- src/server/server.cpp 2015-01-19 11:40:40 +0000
44+++ src/server/server.cpp 2015-01-22 14:28:33 +0000
45@@ -61,6 +61,7 @@
46 MACRO(session_authorizer)\
47 MACRO(session_listener)\
48 MACRO(session_mediator_report)\
49+ MACRO(shell_focus_setter)\
50 MACRO(surface_configurator)
51
52 #define FOREACH_ACCESSOR(MACRO)\
53
54=== modified file 'tests/acceptance-tests/test_client_surface_visibility.cpp'
55--- tests/acceptance-tests/test_client_surface_visibility.cpp 2015-01-19 12:32:12 +0000
56+++ tests/acceptance-tests/test_client_surface_visibility.cpp 2015-01-22 14:28:33 +0000
57@@ -20,6 +20,7 @@
58
59 #include "mir/scene/surface.h"
60 #include "mir/shell/surface_coordinator_wrapper.h"
61+#include "mir/shell/focus_setter.h"
62
63 #include "mir_test_framework/connected_client_with_a_surface.h"
64 #include "mir_test/wait_condition.h"
65@@ -39,6 +40,7 @@
66
67 namespace
68 {
69+
70 class StoringSurfaceCoordinator : public msh::SurfaceCoordinatorWrapper
71 {
72 public:
73@@ -58,17 +60,6 @@
74 return surfaces[index].lock();
75 }
76
77- void raise(std::weak_ptr<ms::Surface> const& /*surface*/) override
78- {
79- // We get some racy "raise" requests from the DefaultFocusManagement
80- // so we ignore any raise requests that we don't issue ourselves
81- }
82-
83- void raise(int index)
84- {
85- msh::SurfaceCoordinatorWrapper::raise(surface(index));
86- }
87-
88 private:
89 std::vector<std::weak_ptr<ms::Surface>> surfaces;
90
91@@ -97,12 +88,24 @@
92
93 void SetUp() override
94 {
95- server.wrap_surface_coordinator([&]
96+ server.wrap_surface_coordinator([]
97 (std::shared_ptr<ms::SurfaceCoordinator> const& wrapped)
98 {
99- auto const result = std::make_shared<StoringSurfaceCoordinator>(wrapped);
100- storing_surface_coordinator = result;
101- return result;
102+ return std::make_shared<StoringSurfaceCoordinator>(wrapped);
103+ });
104+
105+ /*
106+ * Use a null focus setter so that it doesn't change the surface
107+ * order and introduce races to our tests.
108+ */
109+ server.override_the_shell_focus_setter([]
110+ {
111+ struct NullFocusSetter : msh::FocusSetter
112+ {
113+ void set_focus_to(std::shared_ptr<ms::Session> const&) override {}
114+ };
115+
116+ return std::make_shared<NullFocusSetter>();
117 });
118
119 mtf::ConnectedClientWithASurface::SetUp();
120@@ -134,14 +137,17 @@
121
122 mir_surface_spec_release(spec);
123
124- storing_surface_coordinator.lock()->raise(1);
125+ server.the_surface_coordinator()->raise(server_surface(1));
126
127 mir_surface_swap_buffers_sync(second_surface);
128 }
129
130 std::shared_ptr<ms::Surface> server_surface(size_t index)
131 {
132- return storing_surface_coordinator.lock()->surface(index);
133+ auto const storing_surface_coordinator =
134+ std::dynamic_pointer_cast<StoringSurfaceCoordinator>(server.the_surface_coordinator());
135+
136+ return storing_surface_coordinator->surface(index);
137 }
138
139 void move_surface_off_screen()
140@@ -156,7 +162,7 @@
141
142 void raise_surface_on_top()
143 {
144- storing_surface_coordinator.lock()->raise(0);
145+ server.the_surface_coordinator()->raise(server_surface(0));
146 }
147
148 void expect_surface_visibility_event_after(
149@@ -184,7 +190,6 @@
150
151 MirSurface* second_surface = nullptr;
152 testing::NiceMock<MockVisibilityCallback> mock_visibility_callback;
153- std::weak_ptr<StoringSurfaceCoordinator> storing_surface_coordinator;
154 };
155
156 }

Subscribers

People subscribed via source and target branches